IGxRectF.Intersect

Syntax

Intersect(Rect: IGxRectF): IGxRectF;

Parameters

Rect - rectangle, with which the intersection is made.

Description

The Intersect method returns the object that contains the real rectangle that results from intersection of the current real rectangle with another one.

Example

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

Var

Obj, Obj1: ITabObject;

RectF, RectF1, RectF2: IGxRectF;

Begin

RectF:=New GxRectF.Create(0,0,Math.RandBetween(10,60.6),Math.RandBetween(10,60.36));

RectF1:=New GxRectF.Create(0,0,Math.RandBetween(0,40),Math.RandBetween(0,40));

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

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

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

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

RectF2:= RectF.Intersect(RectF1);

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 results from intersection of the rectangles that bound the image.

See also:

IGxRectF