Image.GetPixel

Description

Returns the color of the image at a particular coordinate. The value "0,0" represents the bottom left pixel of the image. Bilinear interpolation is used to determine sub-pixel values.

C# Syntax

Color Image.GetPixel( Double in_dX, Double in_dY );

Scripting Syntax

oReturn = Image.GetPixel( X, Y );

Return Value

The normalized Color of the image at the given coordinate

Parameters

Parameter Type Description
X Double X coordinate on the image.
Y Double Y coordinate on the image.

Examples

VBScript Example

' Replace with your bitmap path
CreateImageClip "$SI_HOME\Data\XSI_SAMPLES\Pictures\jio.jpg"
SelectObj "Clips.jio_jpg"
set oImageClip = Selection(0)
set oImage = oImageClip.GetImage()
set oPixelColor = oImage.GetPixel (0 , 0)
LogMessage "The pixel color is:"
LogMessage "R: " & oPixelColor.Red
LogMessage "G: " & oPixelColor.Green
LogMessage "B: " & oPixelColor.Blue
LogMessage "A: " & oPixelColor.Alpha