IGxRectF.IntersectsWith

Syntax

IntersectsWith(Rect: IGxRectF): Boolean;

Parameters

Rect. Real rectangle, with which it is necessary to check the intersection.

Description

The IntersectsWith method checks if the current rectangle intersects with the rectangle passed as an input parameter.

Example

Sub UserProc;
Var
    r1, r2: IGxRectF;
    b: Boolean;
Begin
    r1 := New GxRectF.Create(-10, -10, Math.RandBetween(020), Math.RandBetween(020));
    r2 := New GxRectF.Create(00, Math.RandBetween(010), Math.RandBetween(010));
    b := r1.IntersectsWith(r2);
    Debug.WriteLine(b ? "Rectangles intersect" : "Rectangles do not intersect");
End Sub UserProc;

After executing the example two real rectangles are created with fixed start points and random size. The development environment console displays a message about intersection of the obtained rectangles.

See also:

IGxRectF