CImage:GetVal
The GetVal method returns the pixel value at coordinate (x,y). The value is returned as a number, even for a color image. The related GetValStr method returns the value as a string, which can accommodate color values.
nVal = CImage:GetVal( x, y ) |
x and y are the column and row pixel coordinates, respectively, and may be passed as numbers or strings.
nVal is a number.
The following script shows an image at path sPath being opened and the pixel value at column 53, row 400 being written to the default Text Editor window:
|
-- Create a CImage |
|
-- Open the image from file path sPath. |
|
-- Return the pixel value at x,y |
|
-- print the pixel value |
CImage class, GetValStr, SetVal
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.