This method retrieves the RGB values from a specified pixel in the designated object. (The screen or the image data). This method is recommended when using scripting or other languages that require variant types.

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetPixelVariant(DeviceValue As Long, x As Long, y As Long, Red As Variant, Green As Variant, Blue As Variant, DeviceMode As OutPutDeviceModeConstants)

Parameters

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

In Visual Basic the following constants can be used: (ikScreen = 0, ikMemoryHandle = 2).

Return Value

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

Explanation

The GetPixelVariant method retrieves the RGB values from the pixel specified by the x and y parameters. This method is recommended when using scripting or other languages that require variant types. 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.

Also see the GetPixel method.

 

The ImageKit8 ActiveX is a product created by Newtone Corporation