wx.GraphicsPenInfo¶This class is a helper used for wx.GraphicsPen creation using the named parameter idiom: it allows specifying various wx.GraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to wx.GraphicsPen constructors.
Typically, you would use wx.GraphicsPenInfo with a wx.GraphicsContext. For example, to start drawing with a dotted blue pen slightly wider than normal you could, write the following:
ctx = wx.GraphicsContext.Create(dc)
pen = ctx.CreatePen(wx.GraphicsPenInfo(wx.BLUE).Width(1.25).Style(wx.PENSTYLE_DOT))
ctx.SetPen(pen)
Added in version 4.1/wxWidgets-3.1.1.
Class Hierarchy¶
Inheritance diagram for class GraphicsPenInfo:
Methods Summary¶Constructor, which can set the colour, width and style for the pen. |
|
Sets the cap (i.e., the end point) for the pen. |
|
Sets the colour for the pen. |
|
Returns the pen’s cap (i.e., end-point style). |
|
Returns the pen’s colour. |
|
Returns the x coordinate of the ending point (if using a gradient). |
|
Returns the y coordinate of the ending point (if using a gradient). |
|
Returns the pen’s gradient type. |
|
Returns the pen’s joining method. |
|
Returns the radius of the radial gradient. |
|
Returns the x coordinate of the starting point (if using a gradient). |
|
Returns the y coordinate of the starting point (if using a gradient). |
|
Returns the pen’s stipple bitmap. |
|
Returns the stops of the gradient. |
|
Returns the pen’s style. |
|
Returns the pen’s line width. |
|
Returns the x coordinate of the starting point (if using a gradient). |
|
Returns the x coordinate of the ending point (if using a gradient). |
|
Returns the y coordinate of the starting point (if using a gradient). |
|
Returns the y coordinate of the ending point (if using a gradient). |
|
Returns whether the pen is transparent. |
|
Sets the join for the pen, which is the appearance of where two lines meet or overlap. |
|
Applies a linear gradient to the pen. |
|
Applies a radial (i.e., circular) gradient to the pen. |
|
Sets the bitmap used for stippling. |
|
Sets the style for the pen. |
|
Sets the line width for the pen. |
Properties Summary¶See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶Possible constructors:
GraphicsPenInfo(colour=Colour(), width=1.0, style=PENSTYLE_SOLID) ->
None
This class is a helper used for GraphicsPen creation using the named parameter idiom: it allows specifying various GraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to GraphicsPen constructors.
Constructor, which can set the colour, width and style for the pen.
Sets the cap (i.e., the end point) for the pen.
cap (PenCap)
Returns the x coordinate of the ending point (if using a gradient).
float
Returns the y coordinate of the ending point (if using a gradient).
float
Returns the pen’s gradient type.
Returns the pen’s joining method.
Returns the radius of the radial gradient.
float
Returns the x coordinate of the starting point (if using a gradient).
float
Returns the y coordinate of the starting point (if using a gradient).
float
Returns the stops of the gradient.
Returns the pen’s style.
Returns the pen’s line width.
float
Returns the x coordinate of the starting point (if using a gradient).
float
Returns the x coordinate of the ending point (if using a gradient).
float
Returns the y coordinate of the starting point (if using a gradient).
float
Returns the y coordinate of the ending point (if using a gradient).
float
Returns whether the pen is transparent.
bool
Sets the join for the pen, which is the appearance of where two lines meet or overlap.
join (PenJoin)
LinearGradient (self, x1, y1, x2, y2, c1, c2, matrix=NullGraphicsMatrix)
Applies a linear gradient to the pen.
x1 (wx.Double) – The x coordinate of the starting point of the gradient.
y1 (wx.Double) – The y coordinate of the starting point of the gradient.
x2 (wx.Double) – The x coordinate of the ending point of the gradient.
y2 (wx.Double) – The y coordinate of the ending point of the gradient.
c1 (wx.Colour) – The starting colour.
c2 (wx.Colour) – The ending colour.
matrix (wx.GraphicsMatrix) – An optional transformation to apply to the gradient.
Note
The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.
LinearGradient (self, x1, y1, x2, y2, stops, matrix=NullGraphicsMatrix)
Applies a linear gradient to the pen, including discontinuous stops in the pattern.
x1 (wx.Double) – The x coordinate of the starting point of the gradient.
y1 (wx.Double) – The y coordinate of the starting point of the gradient.
x2 (wx.Double) – The x coordinate of the ending point of the gradient.
y2 (wx.Double) – The y coordinate of the ending point of the gradient.
stops (wx.GraphicsGradientStops) – A series of stops to include in the pattern.
matrix (wx.GraphicsMatrix) – An optional transformation to apply to the gradient.
Note
The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.
RadialGradient (self, startX, startY, endX, endY, radius, oColor, cColor, matrix=NullGraphicsMatrix)
Applies a radial (i.e., circular) gradient to the pen.
startX (wx.Double) – The x coordinate of the starting point of the gradient.
startY (wx.Double) – The startY coordinate of the starting point of the gradient.
endX (wx.Double) – The endX coordinate of the end of the circle.
endY (wx.Double) – The endY coordinate of the end of the circle.
radius (wx.Double) – The radius of the circle of the gradient (around endX and endY).
oColor (wx.Colour) – The outer colour.
cColor (wx.Colour) – The center colour.
matrix (wx.GraphicsMatrix) – An optional transformation to apply to the gradient.
Note
The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.
RadialGradient (self, startX, startY, endX, endY, radius, stops, matrix=NullGraphicsMatrix)
Applies a radial (i.e., circular) gradient to the pen, including discontinuous stops in the pattern.
startX (wx.Double) – The x coordinate of the starting point of the gradient.
startY (wx.Double) – The startY coordinate of the starting point of the gradient.
endX (wx.Double) – The endX coordinate of the end of the circle.
endY (wx.Double) – The endY coordinate of the end of the circle.
radius (wx.Double) – The radius of the circle of the gradient (around endX and endY).
stops (wx.GraphicsGradientStops) – A series of stops to include in the pattern.
matrix (wx.GraphicsMatrix) – An optional transformation to apply to the gradient.
Note
The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.
Sets the bitmap used for stippling.
When the pen is used, a repeating pattern of this bitmap will be drawn.
stipple (wx.Bitmap)
Sets the line width for the pen.
width (wx.Double)
See GetGradientType