There's no ready-made code to do it, but the pixel information is in the bitmap. This is usually an array of longs with 16 horizontal pixels of 2 bits each. Obviously, the width of each row in longs depends on the width in pixels. Here's an example of what you might do. The details depend on which driver you're using.
con
width = 256 ' bitmap width in pixels
height = 128 ' bitmap height in pixels
var
long bitmap[noparse][[/noparse]height*width/16]
pub pixelValue(x,y)
' First compute the index of the long containing the pixel: (x + y*width) >> 4
' Then shift the long to bring the pixel into the lower 2 bits: long >> (x << 1 & $1F)
' Then mask off the actual pixel value: shifted long & 3
return bitmap[noparse][[/noparse](x + y*width)>>4] >> (x<<1&$1F) & 3
Comments