Contains(X: Double, Y: Double): Boolean;
X - coordinate of the X point.
Y - coordinate of the Y point.
The Contains method returns True if the point with the X and Y coordinates is contained in the integer rectangle.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Obj: ITabObject;
RectF: IGxRectF;
s: String;
x,y: Double;
Begin
RectF:=New GxRectF.Create(0,0,50.5,45.6);
Obj:=UiTabSheet1.TabSheet.Objects.Add("PrxPicture", RectF);
(Obj As IPrxPicture).Image:=GxImage.FromFile("c:\1.bmp");
x:=Math.RandBetween(0,70);
y:=Math.RandBetween(0,70);
If RectF.Contains(x,y) Then
s:="Yes";
Else
s:="No";
End If;
End Sub Button1OnClick;
After executing the example clicking the button creates an image in the regular report. The image source is the 1.bmp file. The S variable contains Yes if the point with the random coordinates is included to the rectangle that bounds the image.
See also: