CRect:Size


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

Syntax

nX, nY = CRect:Size()

where

    nX and nY are numbers representing the width and height. They may be positive or negative.

Example

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

R = NewRect(50,60,250,360)

-- create a CRect object

nX, nY = R:Size()

-- returns the width and height

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

-- prints nx=200, ny=300

Related Topics

Get

CRect class

Image Coordinate System

Subpixel Coordinate Definition