Contains(X: Integer; Y: Integer): Boolean;
X. The X coordinate of the point.
Y. The Y coordinate of the point.
The Contains method checks if the current rectangle contains a point with specified coordinates.
The method returns True if the point with X and Y coordinates is in the integer rectangle area, and False if the point is missing.
Sub UserProc;
Var
Rect: IGxRect;
Begin
Rect := New GxRect.Create(0, 0, 10, 10);
Debug.WriteLine(Rect.Contains(Math.RandBetweenI(-10, 20), Math.RandBetweenI(-10, 20)));
End Sub UserProc;
After executing the example a rectangle is created. The development environment console displays whether the rectangle contains a point with random coordinates.
See also: