RAD Studio
ContentsIndex
PreviousUpNext
Getting the Pen Position

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.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!