Contains(X: Double; Y: Double): 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 the X and Y coordinates is contained in the real rectangle's area, and False if the point is absent.
Sub UserProc;
Var
Rect: IGxRectF;
Begin
Rect := New GxRectF.Create(0, 0, 10.5, 10.5);
Debug.WriteLine(Rect.Contains(Math.RandBetween(-10, 20), Math.RandBetween(-10, 20)));
End Sub UserProc;
After executing the example a real rectangle is created. The development environment console displays whether the rectangle contains a point with random coordinates.
See also: