or you could use
// declarations
type RGB3_t
red as byte
green as byte
blue as byte
endtype
function save_bitmap( strBitmap as string, wBitmap as word )
`// private declarations
local dwPixel as RGB3_t
local dwPos as dword
local dwPos2 as dword
local memblock as dword = wBitmap + 1
`// create memblocks
make memblock from image wBitmap,wBitmap
make memblock memblock,(memblock dword(wBitmap,0)*memblock dword(wBitmap,4))*3 + 11 + 16
`// write header
`// info data
write memblock byte memblock,dwPos,( asc("M")<<8 ) + asc("B") : inc dwPos
write memblock dword memblock,dwPos,get memblock size(memblock) : inc dwPos,4
write memblock byte memblock,dwPos,0 : inc dwPos
write memblock byte memblock dwPos,0 : inc dwPos
write memblock dword memblock,dwPos,28 : inc dwPos,4
`// core data
write memblock dword memblock,dwPos,16 : inc dwPos,4
write memblock dword memblock,dwPos,memblock dword(wBitmap,dwPos-4) : inc dwPos,4
write memblock dword memblock,dwPos,memblock dword(wBitmap,dwPos-4) : inc dwPos,4
write memblock word memblock,dwPos,1 : inc dwPos,2
write memblock word memblock,dwPos,24
dwPos = memblock dword(memblock,7) :`// grab offset value
dwPos2 = 12
`// write data
for indexX = 0 to memblock dword(wBitmap,0) - 1
for indexY = 0 to memblock dword(wBitmap,4) - 1
`// read data
dwPixel.red = memblock byte(wBitmap,dwPos2) : inc dwPos2
dwPixel.green = memblock byte(wBitmap,dwPos2) : inc dwPos2
dwPixel.blue = memblock byte(wBitmap,dwPos2) : inc dwPos2,2
`// write data
write memblock byte memblock,dwPos,dwPixel.red : inc dwPos
write memblock byte memblock,dwPos,dwPixel.green : inc dwPos
write memblock byte memblock,dwPos,dwPixel.blue : inc dwPos
next indexY
next indexX
`// save bitmap
open to write strBitmap,1
make file from memblock 1,memblock
close file 1
`// clear memory
delete memblock wBitmap : delete memblock memblock
endfunction
for some reason my pro IDE doesn't recognise "make file from memblock" only "make file" - possibly a bug cause the function is still in the manual
from the info header see when i write from the previous memblock thats the Width and Height ... and then you have the bits per pixel - however you need to change that to 32
Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?