IGxRectF.ContainsP

Syntax

ContainsP(Point: IGxPointF): Boolean;

Parameters

Point - point that is necessary to check.

Description

The ContainsP method returns True if the point passed by the Point parameter is contained in the real rectangle.

Example

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

Var

Obj: ITabObject;

RectF: IGxRectF;

PointF: IGxPointF;

s: String;

Begin

RectF:=New GxRectF.Create(0,0,50.5,45.6);

PointF:=New GxPointF.Create(Math.RandBetween(0,70),Math.RandBetween(0,70));

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

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

If RectF.ContainsP(PointF) 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:

IGxRectF