DRect Object

A service object used to describe and perform various operations with a rectangle.

Properties

Name Description
left Gets or sets a Double value, representing the coordinate of the leftmost point of the rectangle.
top

Gets or sets a Double value, representing the coordinate of the top point of the rectangle.

right Gets or sets a Double value, representing the coordinate of the rightmost point of the rectangle.
bottom Gets or sets a Double value, representing the coordinate of the bottom point of the rectangle.

Methods

Name Description
Equal Copies properties of an object of the same type.
SetRect Sets left, top, right, bottom points of an object.
InflateRect Extends the rectangle by the X and Y axis, calculates new coordinates of the object.
DeflateRect Shrinks the rectangle by the X and Y axis, calculates new coordinates of the object.
GetWidth Returns the width of the rectangle.
GetHeight Returns the height of the rectangle.
isEmpty Returns TRUE if the square of the rectangle equals to 0. Otherwise returns FALSE.
PtInRect

Returns TRUE if the specified point's coordinates fall within the rectangle's bound. Otherwise returns FALSE.

OffsetRect Moves the rectangle by the X and Y axis, calculates new coordinates of the object.
SetRectEmpty Resets object properties to zero.
UnionRect Calculates the coordinates of the minimum rectangle enough to encompass two specified rectangles. Returns FALSE if the specified rectangles are empty, otherwise returns TRUE.
IntersectRect

Calculates the coordinates of the rectangle, resulting from the intersection of two specified rectangles. If such rectangle exists, returns TRUE, otherwise returns FALSE.

NormalizeRect Resets object properties to defaults.

Remarks

The DRect object is not used in the object hierarchy of ConceptDraw Basic and is used exclusively to facilitate working with rectangles thanks to the methods, implemented in the DRect object.

Example

' The New keyword is used to create a new instance of the object
Dim MyObject as new DRect
' one more method for creating an instance of the object
Dim MySecondObject as DRect set MySecondObject = new DRect

 

See Also

DPoint Object, Dim Statement , Set Statement