Gets a pixel value from the current DIB.
- IPPixelX
The x location of the pixel within the image.
Valid values are greater than or equal to zero.
- IPPixelY
The y location of the pixel within the image.
Valid values are greater than or equal to zero.
If the current DIB is an 8-bit, 4-bit or 1-bit DIB, the returned long value contains the palette index of the pixel. If the current DIB is a 24-bit or 16-bit DIB, the returned long value contains RGB color data formatted as follows:
BBGGRR
where BB, GG and RR are 8-bit byte values.
The following Visual Basic example code illustrates how to extract RGB values from the DIBGetPixel value.
VB Example using DibGetPixel (Visual Basic) | Copy Code |
---|---|
value = ImagXpress1.DIBGetPixel(10,10) If ( ImagXpress1.IBPP <= 8 ) Then thisColor = ImagXpress1.DIBGetPalIndex(value) Else thisColor = value End If red = thisColor And 255 green = Int(thisColor / 256) And 255 blue = Int(thisColor / 65536) And 255 |