CRect:Set
The Set method initializes the 4 properties of the CRect to specific values.
CRect:Set( xmin, xmax, ymin, ymax )
nXmin, nXmax, nYmin, nYmax are numbers that specify the rectangle limits in terms of pixel coordinates. They may be positive or negative.
CRect:Set( CRect )
TheCRect is copied to the properties of the current CRect.
CRect:Set( CImage )
The column and row dimensions of the CImage are copied to the rectangle so that the rectangle extends from 1 to CImage:Cols(), and 1 to CImage:Rows().
CRect:Set( table )
The table must contain numbers in elements [1] through [4]. Thes are assigned in order to the rectangle properties xmin, xmax, ymin, and ymax.
The following script initializes the 4 dimensions of the CRect to xmin=100, xmax=200, ymin=40.5, ymax=300.25. Note the order in which the values are passed, with both x values first, followed by both y values:
|
-- create a CRect object |
|
-- specify the values |
CRect class, SetToImage, Get, Image Coordinate System, Subpixel Coordinate Definition
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.