CImage:SetVal
The SetVal method sets the pixel value at coordinate (x,y).
CImage:SetVal( x, y, val ) |
x and y are the column and row pixel coordinates, respectively, and may be passed as numbers or strings.
val is a number or string to set at x,y.
The new pixel value can be passed as a number or a string and Mira will perform the conversion to a number. To assign a single pixel value to a rectangular region, use SetRegionVal.
The following script shows an image file located at path sPath being opened and the pixel value at column 53, row 100, being set to value 180.5:
|
-- Create a CImage |
|
-- Open the image from file path sPath |
|
-- Set the pixel value at x,y |
|
-- save the image |
CImage class, GetValStr, SetVal, SetRegionVal
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.