RAD Studio
ContentsIndex
PreviousUpNext
Using Pens

The Pen property of a canvas controls the way lines appear, including lines drawn as the outlines of shapes. Drawing a straight line is really just changing a group of pixels that lie between two points. 

The pen itself has four properties you can change:

  • Color property changes the pen color.
  • Width property changes the pen width.
  • Style property changes the pen style.
  • Mode property changes the pen mode.
The values of these properties determine how the pen changes the pixels in the line. By default, every pen starts out black, with a width of 1 pixel, a solid style, and a mode called copy that overwrites anything already on the canvas. 

You can use TPenRecall for quick saving off and restoring the properties of pens.

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