This function retrieves the RGB values from a specified pixel in the designated object (The screen or the image data).

[C++Builder]     BOOL IKGetPixel(LPVOID DeviceValue, int x, int y, LPBYTE Red, LPBYTE Green, LPBYTE Blue, BYTE DeviceMode);
[Delphi]         function IKGetPixel(DeviceValue: THandle; x, y: Integer; var Red, Green, Blue: Byte; DeviceMode: Byte): LongBool;

Parameters

Name Explanation
DeviceValue The device context or the raster image data (Depends on the DeviceMode)
x,y The x,y coordinates of the pixel
Red The red component of the RGB value
Green The green component of the RGB value
Blue The blue component of the RGB value
DeviceMode The designated object (0: Screen, 2: Image data)

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful.

Explanation

The IKGetPixel function retrieves the RGB values from a specified pixel in the designated object (The screen or the image data). This function is enabled when the DeviceMode parameter is 0 or 2. In other words, this function can only be used with the screen or the image data but not with the printer. Please set the x and y parameters in pixel units.

The differences from the ImageKit5

Function Name Parameters
IK5GetPixel: DeviceValue, x, y, Red, Green, Blue
IKGetPixel: DeviceValue, x, y, Red, Green, Blue, DeviceMode

If you pass the value of the IK5SetDeviceMode to the DeviceMode parameter then this method will work in the same way as in the ImageKit5.

 

The ImageKit10 VCL is a product created by Newtone Corporation