CImage:PixGE CImage:ValStr

CImage:Val


The Val method returns the pixel value at coordinate (x,y). The value is returned as a number, even for a color image. The ValStr method returns the value as a string, which can accommodate color values.

Syntax

nVal = CImage:Val( x, y )

Example

The following script fragment shows an image at path sPath being opened and the pixel value at column 53, row 400 being printed to a standard text window:

I = CImage:new()

-- Create a CImage

I:Open( sPath )

-- Open the image from file path sPath.

n = I:Val(53,400)

-- Return the pixel value at x,y

Printf("value=%lg\n",n)

-- print the pixel value

Related Topics

CImage, ValStr, SetVal