IGxRect.Intersect

Syntax

Intersect(Rect: IGxRect): IGxRect;

Parameters

Rect. The rectangle, with which the intersection is made.

Description

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.

Example

Sub UserProc;
Var
    r1, r2, r3: IGxRect;
Begin
    r1 := New GxRect.Create(-10, -101010);
    r2 := New GxRect.Create(002020);
    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:

IGxRect