Gets an RGB value for a palette entry in the current DIB.
Visual Basic |
---|
Public Function DIBGetPalIndex( _ ByVal IPPalIndex As Integer _ ) As OLE_COLOR |
- IPPalIndex
The palette index within the image.
Valid values are greater than or equal to zero and less than 256. The upper limit is determined by the bit depth and number of colors.
The OLE_COLOR value of the palette index.
If the current DIB is an 8-bit, 4-bit or 1-bit DIB, the returned value contains the RGB color value in the palette for the given palette index 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 DIBGetPalIndex value.
VB Example using DIBGetPalIndex (Visual Basic) | Copy Code |
---|---|
thisColor = ImagXpress1.DIBGetPalIndex( 5 ) red = thisColor And 255 green = Int(thisColor / 256) And 255 blue = Int(thisColor / 65536) And 255 |