CRect:Round
The Round method rounds all 4 rectangle limits to the nearest integer value. For example xmax=100.54 becomes xmax=101, and xmax=100.49 becomes xmax=100. This method uses the Round function.
CRect:Round() This method has no arguments and no return value. |
The following script returns the values of the image cursor rectangle and then rounds them to the nearest integer pixel coordinates. Assume that a CImageView V is attached to an image window. Note that the CImage I and CRect R do not need to be created separately, as they are created by the methods that return them as a value.
|
-- create a CImage for the displayed image |
|
-- Create a CRect for the cursor rectangle |
|
-- result: 383.43 502.14 603.43 554.83 |
|
-- round down to integer values |
|
-- result: 383 502 603 555 |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.