UnionRect Method

Calculates the coordinates of a rectangle with the least possible square enough to encompass to specified rectangles. Returns a Boolean value: FALSE, if the specified rectangles are empty, otherwise - TRUE.

Applies to objects: DRect

Syntax

[[Let] res =] object.UnionRect (inRect1, inRect2)

The UnionRect method syntax has these parts:

Part Description
object A reference to an instance of the object.
inRect1, inRect2

References to instances of the DRect object.

res Variable of a Boolean type.

Remarks

If inRect1 and inRect2 have zero square, this method returns False, and the properties of the instance of the object object, for which the method was called, are reset to zero.

Example

Dim outRect as new DRect, inRect1 as new DRect, inRect2 as new DRect, res as Boolean
inRect1.SetRect(100,100,200,200)
inRect2.SetRect(200,200,400,400)
'outRect properties take these values: 100,100,400,400 res = outRect.UnionRect(inRect1,inRect2) ' return TRUE

 

See Also

DRect Object