#include <Pt/Gfx/Pen.h>
Outline color, width and style. More...
Public Types | |
| enum | Style |
| Identifies how outlines are stroked. | |
| enum | CapStyle |
| Identifies how open line ends are rendered. | |
| enum | JoinStyle |
| Identifies how connected line segments are joined. | |
Public Member Functions | |
| Pen () | |
| Constructs a null pen. | |
| Pen (const Color &color) | |
| Constructs a pen with the specified color. | |
| Pen (const Color &color, std::size_t width, Style style=Solid, CapStyle cap=FlatCap, JoinStyle join=BevelJoin) | |
| Constructs a pen with the specified size, color and styles. | |
| Pen (const Color &color, std::size_t width, const std::vector< Pt::uint8_t > &dashPattern, CapStyle cap=FlatCap, JoinStyle join=BevelJoin) | |
| Constructs a pen with a custom dash pattern. | |
| bool | isNull () const |
| Returns true if the pen is null. | |
| void | setSize (std::size_t size) |
| Sets the size of the pen. | |
| std::size_t | size () const |
| Returns the size of the pen. | |
| void | setColor (const Color &color) |
| Sets the color of the pen. | |
| const Color & | color () const |
| Returns the color of the pen. | |
| void | setStyle (Style style=Solid) |
| Sets the pen style. | |
| Style | style () const |
| Returns the pen style. | |
| bool | isSolid () const |
| Returns true if the pen is solid. | |
| void | setDashPattern (const std::vector< Pt::uint8_t > &dashPattern) |
| Sets the pen user dash pattern. | |
| const std::vector< Pt::uint8_t > & | dashPattern () const |
| Returns the pen user dash pattern. | |
| void | setCapStyle (CapStyle cap=FlatCap) |
| Sets the cap style. | |
| CapStyle | capStyle () const |
| Returns the cap style. | |
| void | setJoinStyle (JoinStyle join=BevelJoin) |
| Sets the join style. | |
| JoinStyle | joinStyle () const |
| Returns the join style. | |
| const void * | instance () const |
| Returns an implementation-specific pen instance. | |
Pen describes how a painter strokes lines, polylines, arcs, rectangle and ellipse outlines, paths, and text outlines. The default pen is null and does not stroke. A pen constructed from a Color is solid, one pixel wide, with round caps and joins.
Style selects solid, dotted, dashed, or a custom dash pattern. CapStyle is the shape of open ends. JoinStyle is the shape of corners. Width is in logical units.
| Pen | ( | ) |
The default pen is null.
| Pen | ( | const Color & | color | ) |
The pen size is 1, the style is solid and the cap and join styles are round.