Accusoft ImagXpress 13
DIBGetPalIndex Method

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. 

Description
Gets an RGB value for a palette entry in the current DIB.
Syntax
Visual Basic
Public Function DIBGetPalIndex( _
   ByVal IPPalIndex As Integer _
) As OLE_COLOR
Parameters
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. 

Return Type
The OLE_COLOR value of the palette index.
Remarks

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.

Example
The following Visual Basic example code illustrates how to extract RGB values from the DIBGetPalIndex value.
thisColor = ImagXpress1.DIBGetPalIndex( 5 )
red = thisColor And 255
green = Int(thisColor / 256) And 255
blue = Int(thisColor / 65536) And 255
See Also

ImagXpress Object  | ImagXpress Members  | DIBSetPalIndex Method

 

 


©2018. Accusoft Corporation. All Rights Reserved.

Send Feedback