IGxRect.ContainsP

Syntax

ContainsP(Point: IGxPoint): Boolean;

Parameters

Point - point that is necessary to check.

Description

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

Example

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:

IGxRect