RAD Studio |  |

Getting the Pen Position
See Also
Collapse All

The current drawing position—the position from which the pen begins drawing its next line—is called the pen position. The canvas stores its pen position in its PenPos property. Pen position affects the drawing of lines only; for shapes and text, you specify all the coordinates you need.

To set the pen position, call the MoveTo method of the canvas. For example, the following code moves the pen position to the upper left corner of the canvas:

Copy Code

    Canvas.MoveTo(0, 0);

Copy Code

    Canvas->MoveTo(0, 0);

Note: Drawing a line with the LineTo method also moves the current position to the endpoint of the line.
See Also

Changing the Pen Color

Changing the Pen Width

Changing the Pen Style

Changing the Pen Mode

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!