GetPixel

The GetPixel function retrieves the color (RGB) of pixel at the specified coordinates.

GetPixel nX, nY

Parameters

nX
Specifies the x-coordinate, in pixels, of the point to be set.

nY
Specifies the y-coordinate, in pixels, of the point to be set.

Return value

If function call is successful (the specified point is inside of imagespace) then function returns the array. Array consists of the three elements (R,G and B components of color). Otherwise, function returns empty value. You can check the returned variable using IsArray (or similar) function before using it.

Remarks

This function works either on primary or secondary imagespace dependently on which imagespace is active (SelectClipboard).

Example
All error checkings are omitted to make example more simple

.......................................
set obj=Server.CreateObject("shotgraph.image")

' This example reads the image into imagespace
' and retrieves the color of point 25x10.
itype=obj.GetFileDimensions(pathtofile,xsize,ysize)
obj.CreateImage xsize,ysize,256
obj.ReadImage pathtofile,pal,0,0
rgb=obj.GetPixel(25,10)
' Now the rgb(0) contains the red color component value,
' rgb(1) contains the green value,
' rgb(2) contains the blue value


.......................................