CRect:Set


The Set method initializes the 4 properties of the CRect to specific values.

Syntax

CRect:Set( xmin, xmax, ymin, ymax )

bullet.gif    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 )

bullet.gif    TheCRect is copied to the properties of the current CRect.

CRect:Set( CImage )

bullet.gif    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 )

bullet.gif    The table must contain numbers in elements [1] through [4]. Thes are assigned in order to the rectangle properties xmin, xmax, ymin, and ymax.

Example

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:

R = new_rect()

-- create a CRect object

R:Set(100,200,40.5,300.25)

-- specify the values

Related Topics

CRect class, SetToImage, Get, Image Coordinate System, Subpixel Coordinate Definition

 

Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.