phoenix_title 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 Class Hierarchy

Inheritance diagram for class GraphicsPenInfo:

method_summary Methods Summary

__init__

Constructor, which can set the colour, width and style for the pen.

Cap

Sets the cap (i.e., the end point) for the pen.

Colour

Sets the colour for the pen.

GetCap

Returns the pen’s cap (i.e., end-point style).

GetColour

Returns the pen’s colour.

GetEndX

Returns the x coordinate of the ending point (if using a gradient).

GetEndY

Returns the y coordinate of the ending point (if using a gradient).

GetGradientType

Returns the pen’s gradient type.

GetJoin

Returns the pen’s joining method.

GetRadius

Returns the radius of the radial gradient.

GetStartX

Returns the x coordinate of the starting point (if using a gradient).

GetStartY

Returns the y coordinate of the starting point (if using a gradient).

GetStipple

Returns the pen’s stipple bitmap.

GetStops

Returns the stops of the gradient.

GetStyle

Returns the pen’s style.

GetWidth

Returns the pen’s line width.

GetX1

Returns the x coordinate of the starting point (if using a gradient).

GetX2

Returns the x coordinate of the ending point (if using a gradient).

GetY1

Returns the y coordinate of the starting point (if using a gradient).

GetY2

Returns the y coordinate of the ending point (if using a gradient).

IsTransparent

Returns whether the pen is transparent.

Join

Sets the join for the pen, which is the appearance of where two lines meet or overlap.

LinearGradient

Applies a linear gradient to the pen.

RadialGradient

Applies a radial (i.e., circular) gradient to the pen.

Stipple

Sets the bitmap used for stippling.

Style

Sets the style for the pen.

Width

Sets the line width for the pen.


property_summary Properties Summary

EndX

See GetEndX

EndY

See GetEndY

GradientType

See GetGradientType

Radius

See GetRadius

StartX

See GetStartX

StartY

See GetStartY

Stops

See GetStops

X1

See GetX1

X2

See GetX2

Y1

See GetY1

Y2

See GetY2


api Class API

class wx.GraphicsPenInfo(object)

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.


Methods

__init__(self, colour=Colour(), width=1.0, style=PENSTYLE_SOLID)

Constructor, which can set the colour, width and style for the pen.

Parameters:
Return type:

None



Cap(self, cap)

Sets the cap (i.e., the end point) for the pen.

Parameters:

cap (PenCap)

Return type:

wx.GraphicsPenInfo



Colour(self, col)

Sets the colour for the pen.

Parameters:

col (wx.Colour)

Return type:

wx.GraphicsPenInfo



GetCap(self)

Returns the pen’s cap (i.e., end-point style).

Return type:

wx.PenCap



GetColour(self)

Returns the pen’s colour.

Return type:

wx.Colour



GetEndX(self)

Returns the x coordinate of the ending point (if using a gradient).

Return type:

float



GetEndY(self)

Returns the y coordinate of the ending point (if using a gradient).

Return type:

float



GetGradientType(self)

Returns the pen’s gradient type.

Return type:

wx.GradientType



GetJoin(self)

Returns the pen’s joining method.

Return type:

wx.PenJoin



GetRadius(self)

Returns the radius of the radial gradient.

Return type:

float



GetStartX(self)

Returns the x coordinate of the starting point (if using a gradient).

Return type:

float



GetStartY(self)

Returns the y coordinate of the starting point (if using a gradient).

Return type:

float



GetStipple(self)

Returns the pen’s stipple bitmap.

Return type:

wx.Bitmap



GetStops(self)

Returns the stops of the gradient.

Return type:

wx.GraphicsGradientStops



GetStyle(self)

Returns the pen’s style.

Return type:

wx.PenStyle



GetWidth(self)

Returns the pen’s line width.

Return type:

float



GetX1(self)

Returns the x coordinate of the starting point (if using a gradient).

Return type:

float



GetX2(self)

Returns the x coordinate of the ending point (if using a gradient).

Return type:

float



GetY1(self)

Returns the y coordinate of the starting point (if using a gradient).

Return type:

float



GetY2(self)

Returns the y coordinate of the ending point (if using a gradient).

Return type:

float



IsTransparent(self)

Returns whether the pen is transparent.

Return type:

bool



Join(self, join)

Sets the join for the pen, which is the appearance of where two lines meet or overlap.

Parameters:

join (PenJoin)

Return type:

wx.GraphicsPenInfo



LinearGradient(self, *args, **kw)

overload Overloaded Implementations:



LinearGradient (self, x1, y1, x2, y2, c1, c2, matrix=NullGraphicsMatrix)

Applies a linear gradient to the pen.

Parameters:
  • 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.

Return type:

wx.GraphicsPenInfo

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.

Parameters:
  • 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.

Return type:

wx.GraphicsPenInfo

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, *args, **kw)

overload Overloaded Implementations:



RadialGradient (self, startX, startY, endX, endY, radius, oColor, cColor, matrix=NullGraphicsMatrix)

Applies a radial (i.e., circular) gradient to the pen.

Parameters:
  • 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.

Return type:

wx.GraphicsPenInfo

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.

Parameters:
  • 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.

Return type:

wx.GraphicsPenInfo

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.





Stipple(self, stipple)

Sets the bitmap used for stippling.

When the pen is used, a repeating pattern of this bitmap will be drawn.

Parameters:

stipple (wx.Bitmap)

Return type:

wx.GraphicsPenInfo



Style(self, style)

Sets the style for the pen.

Parameters:

style (PenStyle)

Return type:

wx.GraphicsPenInfo



Width(self, width)

Sets the line width for the pen.

Parameters:

width (wx.Double)

Return type:

wx.GraphicsPenInfo


Properties

EndX

See GetEndX



EndY

See GetEndY



GradientType

See GetGradientType



Radius

See GetRadius



StartX

See GetStartX



StartY

See GetStartY



Stops

See GetStops



X1

See GetX1



X2

See GetX2



Y1

See GetY1



Y2

See GetY2