Images and Banks

BlitzPlus Forums/BlitzPlus Programming/Images and Banks

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

When you load an image, it is stored with alpha value regardless of whether it had it or not. So each pixel color is 4 bytes long.

The pixel data is stored in one continuous row, and if you wanted to pokeInt data into it at specific X/Y positions you will have to know the pitch of the imagebuffer. This determines how many bytes there is until a new line is stored. See the previous example I posted for how to do the offset calculations.

The following is untested as I don't have the option of using my blitz at this computer I am at.

size = ImageWidth( temp ) * ImageHeight( temp )
for count = 0 to size-1
   peekdata = peekInt( imagebank, count*4 ) and $FFFFFF
   red = ( peekdata shr 16 ) and $FF
   green = ( peekdata shr 8 ) and $FF
   blue = peekdata and $FF
   WriteLine( saveingdata, peekdata )
   ; Writeline( savingdata, red+","+green+","+blue )
next