CImage:SetVal
The SetVal method sets the pixel value at coordinate (x,y).
CImage:SetVal( x, y, val ) |
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. |
|
-- Return the pixel value at x,y |
|
-- save the image |
|
-- delete the CImage from memory |