IGxRect.Contains

Syntax

Contains(X: Integer, Y: Integer): Boolean;

Parameters

X - coordinate of the X point.

Y - coordinate of the Y point.

Description

The Contains method returns True if the point with the X and Y coordinates is contained in the integer rectangle.

Example

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

Var

Obj: ITabObject;

Rect: IGxRect;

s: String;

x,y: Integer;

Begin

Rect:=New GxRect.Create(0,0,50,45);

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

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

x:=Math.RandBetweenI(0,70);

y:=Math.RandBetweenI(0,70);

If Rect.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:

IGxRect