Accusoft ImagXpress 13
DIBGetPixel Method

The x location of the pixel within the image.

Valid values are greater than or equal to zero.

The y location of the pixel within the image.

Valid values are greater than or equal to zero.

Description
Gets a pixel value from the current DIB.
Syntax
Visual Basic
Public Function DIBGetPixel( _
   ByVal IPPixelX As Long, _
   ByVal IPPixelY As Long _
) As OLE_COLOR
Parameters
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.

Remarks

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.

Example
The following Visual Basic example code illustrates how to extract RGB values from the DIBGetPixel value.
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
See Also

ImagXpress Object  | ImagXpress Members  | DIBSetPixel Method

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback