CImage:SetVal
The SetVal method sets the pixel value at coordinate (x,y).
CImage:SetVal( x, y, val ) |
whereval is a number or string.
x and y are the column and row pixel coordinates, respectively, and may be passed as numbers or strings.
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:
I = CImage:new() |
-- Create a CImage |
I:Open( sPath ) |
-- Open the image from file path sPath. |
I:SetVal( 53, 100, 180.5 ) |
-- Return the pixel value at x,y |
I:Save() |
-- save the image |
I:delete() |
-- delete the CImage from memory |