Intersect(Rect: IGxRect): IGxRect;
Rect. The rectangle, with which the intersection is made.
The Intersect method returns the rectangle that is the result of intersection of the current integer rectangle and a rectangle passed as an input parameter.
Sub UserProc;
Var
r1, r2, r3: IGxRect;
Begin
r1 := New GxRect.Create(-10, -10, 10, 10);
r2 := New GxRect.Create(0, 0, 20, 20);
r3 := r1.Intersect(r2);
Debug.WriteLine("Left: " + r3.Left.ToString + ". Right: " + r3.Right.ToString + ". Top: " + r3.Top.ToString + ". Bottom: " + r3.Bottom.ToString +
"; Width: " + r3.Width.ToString + ". Height: " + r3.Height.ToString);
End Sub UserProc;
After executing the example two rectangles are created. The integer rectangle is obtained that is the result of intersection of two rectangles. Coordinates and size of the obtained rectangle are displayed in the development environment console.
See also: