wx.lib.graphics.GraphicsBrush¶
A GraphicsBrush
is used to define how fills are painted.
They can have either a solid fill (colors with or without alpha), a
stipple created from a wx.Bitmap
, or a Cairo Pattern
object.
Class Hierarchy¶
Known Superclasses¶
wx.lib.graphics.GraphicsObject
Methods Summary¶
Create a new |
|
Apply this brush’s properties to the given context. |
|
Converts a |
|
Create a |
Properties Summary¶
The color to use when filling with the brush. |
|
A pattern to be used when filling with this brush. |
|
The Stipple is a bitmap to be used as a pattern when filling with this brush. |
|
The style of the brush to be used when filling. |
Class API¶
- class GraphicsBrush(GraphicsObject)¶
A
GraphicsBrush
is used to define how fills are painted. They can have either a solid fill (colors with or without alpha), a stipple created from awx.Bitmap
, or a CairoPattern
object.
Methods¶
- __init__(self, colour=wx.BLACK, style=wx.BRUSHSTYLE_SOLID)¶
Create a new
GraphicsBrush
.
- Apply(self, ctx)¶
Apply this brush’s properties to the given context. Called by
GraphicsContext
as needed.
- static CreateFromPattern(pattern)¶
Create a
GraphicsBrush
directly from a CairoPattern
object. This is similar to using a stipple bitmap, but saves a step, and patterns can include gradients, etc.
Properties¶
- Pattern¶
A pattern to be used when filling with this brush.
- Type:
Cairo
Pattern
- Stipple¶
The Stipple is a bitmap to be used as a pattern when filling with this brush.
This will be converted to a Cairo
Pattern
when applied to aGraphicsContext
.- Type:
- Style¶
The style of the brush to be used when filling. Currently,
wx.BRUSHSTYLE_SOLID
andwx.BRUSHSTYLE_STIPPLE
are supported.- Type: