IGxRect.Intersect

Syntax

Intersect(Rect: IGxRect): IGxRect;

Parameters

Rect - rectangle, with which the intersection is made.

Description

The Intersect method returns the object that contains the integer rectangle that is the result of intersection between this integer rectangle with another one.

Example

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Obj, Obj1: ITabObject;

Rect, Rect1, Rect2: IGxRect;

Begin

Rect:=New GxRect.Create(0,0,Math.RandBetweenI(10,60),Math.RandBetweenI(10,60));

Rect1:=New GxRect.Create(0,0,Math.RandBetweenI(0,40),Math.RandBetweenI(0,40));

Obj:=UiTabSheet1.TabSheet.Objects.Add("PrxPicture", Rect.ToRectF);

Obj1:=UiTabSheet1.TabSheet.Objects.Add("PrxPicture", Rect1.ToRectF);

(Obj As IPrxPicture).Image:=GxImage.FromFile("c:\1.bmp");

(Obj1 As IPrxPicture).Image:=GxImage.FromFile("c:\2.bmp");

Rect2:= Rect.Intersect(Rect1);

End Sub Button1OnClick;

After executing the example clicking the button creates two images in the regular report. Image sources are the 1.bmp and 2.bmp files. The RectF2 variable contains the integer rectangle that is implemented after the intersection of the rectangles that bound the image.

See also:

IGxRect