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

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPixel(DeviceValue As LONG_PTR, x As Long, y As Long, Red As Integer, Green As Integer, Blue As Integer, DeviceMode As OutPutDeviceModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().GetPixel(LONG_PTR DeviceValue, long x, long y, short *Red, short *Green, short *Blue, long DeviceMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPixel(DeviceValue As Integer(x86) or Long(x64), x As Integer, y As Integer, ByRef Red As Short, ByRef Green As Short, ByRef Blue As Short, DeviceMode As ImageKit10(A)Lib.OutPutDeviceModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.GetPixel(int(x86) or long(x64) DeviceValue, int x, int y, ref short Red, ref short Green, ref short Blue, ImageKit10(A)Lib.OutPutDeviceModeConstants DeviceMode)

* ImageKit10ALib refers to the ANSI version, ImageKit10Lib refers to the Unicode version, (x86) refers to the 32 bit version, and (x64) refers to the 64 bit version.

Parameters

Name Explanation
DeviceValue The device context or the raster image data (i.e. Hdc or ImageHandle)
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)

The following constants can be used: (ikScreen = 0, ikMemoryHandle = 2).

Return Value

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

Explanation

The GetPixel method retrieves the RGB values from the pixel specified by the x and y parameters. This method is enabled when the DeviceMode parameter is 0 or 2. In other words, this method 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.

Note: With the Visual Basic PictureBox, the AutoRedraw property must be set to True.

For scripting languages, other programs that require variant types, or when using 64 bit builds in VB.NET or C#, please refer to the GetPixelVariant method.

Differences between the ImageKit7/8

The hDC argument type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation