Getting the Pen Position

From RAD Studio
Jump to: navigation, search

Go Up to Using Pens

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:

Canvas.MoveTo(0, 0);
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