IntersectsWith(Rect: IGxRectF): Boolean;
Rect. Real rectangle, with which it is necessary to check the intersection.
The IntersectsWith method checks if the current rectangle intersects with the rectangle passed as an input parameter.
Sub UserProc;
Var
r1, r2: IGxRectF;
b: Boolean;
Begin
r1 := New GxRectF.Create(-10, -10, Math.RandBetween(0, 20), Math.RandBetween(0, 20));
r2 := New GxRectF.Create(0, 0, Math.RandBetween(0, 10), Math.RandBetween(0, 10));
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: