User Guide
Ruby Component
Here's an example showing how the round and triangle options work:
Brushed Lines
We've seen how it's possible to fill a shape using a brush. Well you can also use a brush to fill a line drawn with a pen. To do this use the
setBrush method of the Pen object.
setBrush brush
The input is a brush object. You can use any kind of brush, gradient, hatched, texture, path or solid.The example below shows two lines
being drawn with hatch and texture brushes.
Line Caps
Line caps define how the end points of a line are drawn. By default lines are squared off at the ends but you may want a rounded or
triangular end to your lines and line caps allow you to do this.
You can also have a larger shape at the start or end of a line. This is called an Anchor. The most familiar line cap anchor is the arrow head
but there are several more standard ones and you can also make your own.
Line caps are properties of Pen objects. To set the line caps for a pen there are two Pen class methods, one for setting the cap at the start of
the line and one for setting the one at the end:
setStartCap type
setEndCap type
The type parameter can be any of the following strings:
144 of 212