ContainsR(Rect: IGxRect): Boolean;
Rect - rectangle that is necessary to check.
The ContainsR method returns True if the real Rect rectangle is contained in this rectangle.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Obj, Obj1: ITabObject;
Rect, Rect1: IGxRect;
s: String;
Begin
Rect:=New GxRect.Create(0,0,Math.RandBetweenI(0,32),Math.RandBetweenI(0,28));
Rect1:=New GxRect.Create(0,0,Math.RandBetweenI(0,31),Math.RandBetweenI(0,25));
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");
If Rect.ContainsR(Rect1) Then
s:="Yes";
Else
s:="No";
End If;
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 S variable contains Yes if the rectangle that bounds the second image is included to the rectangle that bounds the first image.
See also: