IntersectRect Method

Calculates the coordinates of the rectangle, corresponding to the area of intersection of the two specified rectangles. Returns a Boolean value: TRUE if the rectangles intersect, otherwise FALSE.

Applies to objects: DRect

Syntax

object.IntersectRect (inRect1, inRect2)

The IntersectRect method syntax has these parts:

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

References to DRect objects.

res A Boolean type variable.

Remarks

Note, that if the method returns FALSE, object properties 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,300,300)
inRect2.SetRect(200,200,400,400)
' intersect rect ' After the method has been called, ' outRect properties will become equal to 200,200,300,300
res = outRect.IntersectRect(inRect1,inRect2) ' return TRUE

 

See Also

DRect Object