OffsetP(Point: IGxPoint);
Point. The point, by which coordinates the offset is made.
The OffsetP method offsets the current rectangle by coordinates values of the point passed by the input parameter.
Sub UserProc;
Var
r1: IGxRect;
p1: IGxPoint;
Begin
r1 := New GxRect.Create(0, 0, 10, 10);
p1 := New GxPoint.Create(Math.RandBetweenI(-10, 10), Math.RandBetweenI(-10, 10));
r1.OffsetP(p1);
Debug.WriteLine("Left: " + r1.Left.ToString + ". Top: " + r1.Top.ToString);
End Sub UserProc;
After executing the example an integer rectangle and a point are created. The point is created with random coordinates. Then rectangle coordinates are offset by point coordinates. The obtained coordinates of the rectangle's left top side are displayed in the development environment console.
See also: