This method sets a color in the specified pixel in the designated object (screen, or image data).

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.SetPixel(DeviceValue As LONG_PTR, x As Long, y As Long, Color As OLE_COLOR, DeviceMode As OutPutDeviceModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().SetPixel(LONG_PTR DeviceValue, long x, long y, unsigned long Color, long DeviceMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.SetPixel(DeviceValue As Integer(x86) or Long(x64), x As Integer, y As Integer Color As UInteger, DeviceMode As ImageKit10(A)Lib.OutPutDeviceModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.SetPixel(int(x86) or long(x64) DeviceValue, int x, int y, uint Color, 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
Color The new color of the pixel
DeviceMode The designated object where the pixel color is set (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 SetPixel method sets a color specified by the Color parameter into the pixel whose coordinates are specified by the x and y parameters. To set the Color parameter, use the RGB(red, green, blue) value. If the specified color can not be accurately produced by the device, the nearest color is used.

This method can draw in the following designated objects: screen and image data. This method is enabled when the DeviceMode parameter is 0 or 2 (the designated object is the screen or the image data). Please set the x and y parameters in pixel units.

Note: In the Visual Basic PictureBox, please set the AutoRedraw property to True.

Differences between ImageKit7/8

The DeviceValue and Color arguments' type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation