CRect:Get CRect:SetToImage

CRect:Set


The Set method initializes the 4 data members of the CRect to specific values or to values in another CRect. To initialize to a full image, use SetToImage.

Syntax

CRect:Set( nXmin, nXmax, nYmin, nYmax )

    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 argument is copied to the data members of the current CRect.

Example

The following script fragment initializes the 4 dimensions of the CRect as 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 = CRect:new()

-- create a CRect object

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

-- specify the values

Related Topics

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