wx.lib.graphics.GraphicsPen¶
A GraphicsPen
is used to define the properties of how a stroke is drawn.
The properties and features of this class are similar to wx.Pen
,
and a wx.Pen
can be used to initialize a GraphicsPen
using the
GraphicsPen.CreateFromPen
staticmethod.
Class Hierarchy¶
Known Superclasses¶
wx.lib.graphics.GraphicsObject
Methods Summary¶
Create a new |
|
Apply this pen’s properties to the given context. |
|
Create a |
|
Convert a |
Properties Summary¶
The style of the end cap used when drawing with the pen. |
|
The color associated with this pen, to be used when drawing the line. |
|
Dashes is a sequence of values defining the size of line segments and blanks |
|
The pen’s join style, used when drawing connected lines. |
|
A pattern to be used when drawing a line with the pen. |
|
Stipple is a bitmap to use as a pattern when drawing a line with the pen. |
|
Defines the type of pen, including things like solid, dashed, stipple, etc. |
|
The width of the line to be drawn with this pen. |
Class API¶
- class GraphicsPen(GraphicsObject)¶
A
GraphicsPen
is used to define the properties of how a stroke is drawn.The properties and features of this class are similar to
wx.Pen
, and awx.Pen
can be used to initialize aGraphicsPen
using theGraphicsPen.CreateFromPen
staticmethod.
Methods¶
- __init__(self, colour=wx.BLACK, width=1, style=wx.SOLID)¶
Create a new
GraphicsPen
- Apply(self, ctx)¶
Apply this pen’s properties to the given context. Called by
GraphicsContext
as needed.
- static CreateFromPattern(pattern, width=1)¶
Create a
GraphicsPen
directly from a Cairo Pattern object. This is similar to using a stipple bitmap, but saves a step, and patterns can include gradients, etc.
- static CreateFromPen(pen)¶
Convert a
wx.Pen
orwx.GraphicsPenInfo
to aGraphicsPen
Properties¶
- Dashes¶
Dashes is a sequence of values defining the size of line segments and blanks to use when drawing a line.
- Join¶
The pen’s join style, used when drawing connected lines.
The default is
wx.JOIN_ROUND
.- Type:
- Pattern¶
A pattern to be used when drawing a line with the pen.
- Type:
Cairo
Pattern
- Stipple¶
Stipple is a bitmap to use as a pattern when drawing a line with the pen.
This will be converted to a Cairo
Pattern
when applied to aGraphicsContext
.- Type:
- Style¶
Defines the type of pen, including things like solid, dashed, stipple, etc.
- Type:
- Width¶
The width of the line to be drawn with this pen.
- Type:
int or float