NewRect
The NewRect function creates and returns a new CRect object. This function is a global form of the CRect:new method. The CRect class includes 4 properties that describe the minimum and maximum x values and the minimum and maximum y values. You can treat this object as a classic rectangle or you can use it simply to hold and manipulate 4 numbers.
R = NewRect() R = NewRect( CRectOld ) R = NewRect( xmin, xmax, ymin, ymax ) R = NewRect( CImage ) R = NewRect( CPoint ) R = NewRect( array ) where
|
Since this function returns a new CRect object, it can be used in an expression like I:SetRegion(t,NewRect(Pt)).
The following script illustrates using various forms of NewRect. All produce the same result:
|
|
|
-- create CRect A and set values |
|
-- result: 100:300, 400:800 |
|
|
|
-- copy CRect A to a new CRect B |
|
-- result: 100:300, 400:800 |
|
|
|
-- create a default CRect C |
|
|
|
-- result: 100:300, 400:800 |