ContainsP(Point: IGxPoint): Boolean;
Point - point that is necessary to check.
The ContainsP method returns True if the point that is passed by the Point parameter is contained in the integer rectangle.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Obj: ITabObject;
Rect: IGxRect;
Point: IGxPoint;
s: String;
Begin
Rect:=New GxRect.Create(0,0,50,45);
Point:=New GxPoint.Create(Math.RandBetweenI(0,70),Math.RandBetweenI(0,70));
Obj:=UiTabSheet1.TabSheet.Objects.Add("PrxPicture", Rect.ToRectF);
(Obj As IPrxPicture).Image:=GxImage.FromFile("c:\1.bmp");
If Rect.ContainsP(Point) 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: