CRect:Height

CRect:Size


The Size method returns the x and y length of the CRect object. The size is measured in pixel coordinates.

Syntax

nSizeX, nSizeY = CRect:Size()

    nX and nY are numbers and may be positive or negative.

Example

The following script fragment prints the x and y dimensions of the CRect:

 

R = CRect:new()

-- create a CRect object

R:Set(50,60,250,360)

--set the rectangle data

nX, nY = R:Size()

-- returns the width and height

Printf( "nx=%.0lf, ny=%.0lf\n", nX,nY)

-- prints nx=200, ny=300

Related Topics

CRect, Get, Image Coordinate System, Subpixel Coordinate Definition