createPen () : nodeset
This method enables the creation of a pen as a drawing element. The method enables the transfer of the parameters “color”, “width”, “lineStyle”, “endCap”, “cornerJoin” and “alignment” with which the drawing behaviour of the pen can be controlled. If these values are not transferred, then the default values are used – you will find these in the following list.
- width = 1
- lineStyle = Solid
- endCap = Flat
- cornerJoin = Miter
- alignment = Center
The syntax of the method is illustrated in the following example.
In the following example, it is shown how to use the method.
This example draws a line into an existing picture. To start with, a workspace is produced with an existing picture, and then a pen is created with the colour red. Using the pen as a drawing element, a line is now written into the workspace, which will be written into the output stream in the following.