Instant properties: area

The instant property area represents the area occupied by a rectangle stored within a rect operand and is expressed in pixel.

Declaration

int32 rect.area

Discussion

The read access to this property results in the area occupied by the rectangle. The area is calculated by multiplying the width of the rectangle with its height. If the width, or the height are negative, the resulting area can become negative too. If the width or the height are zero, the area will also results in 0 (zero). Please note, this property is read-only. The write access to this property is not allowed. For example:

var rect r = <100,200,110,220>; // Calculate the area of the rectangle var int32 result = r.area; // result = 200 // Modification is not allowed r.area = 1200; // Chora compiler error