Accusoft ImagXpress 12
DIBGetPalIndex Method
See Also  Example  Send comments on this topic.
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. 

AccusoftImagXpress12 ActiveX DLL > ImagXpress Object : DIBGetPalIndex Method

Glossary Item Box

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.
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

See Also

©2013. Accusoft Corporation. All Rights Reserved.