Readpixel problem with 16-32 bits display mode

BlitzPlus Forums/BlitzPlus Programming/Readpixel problem with 16-32 bits display mode

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.

Hi !
i've some problems with this code. It's work fine if the desktop display current depth setting is 32 bits. But not with 16 bits mode. (i've not tested with 24 bits). Could you help me ? Thanks !

Graphics 800,600,32,2
Mask =CreateImage(100,100)
SetBuffer ImageBuffer(Mask)
Color 255,0,255
Rect 0,0,100,100
SetBuffer BackBuffer()
DrawImage mask,0,0
col = ReadPixel (50 , 50, ImageBuffer(Mask)) And $FFFFFF
If col = $ff00ff Then Notify "YES ;-)" Else Notify "no ;-("