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

Inheritance diagram for class GraphicsBrush:

super_classes Known Superclasses

wx.lib.graphics.GraphicsObject


method_summary Methods Summary

__init__

Create a new GraphicsBrush.

Apply

Apply this brush’s properties to the given context.

CreateFromBrush

Converts a wx.Brush to a GraphicsBrush.

CreateFromPattern

Create a GraphicsBrush directly from a Cairo Pattern object.


property_summary Properties Summary

Colour

The color to use when filling with the brush.

Pattern

A pattern to be used when filling with this brush.

Stipple

The Stipple is a bitmap to be used as a pattern when filling with this brush.

Style

The style of the brush to be used when filling.


api 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 a wx.Bitmap, or a Cairo Pattern 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 CreateFromBrush(brush)

Converts a wx.Brush to a GraphicsBrush.



static CreateFromPattern(pattern)

Create a GraphicsBrush directly from a Cairo Pattern object. This is similar to using a stipple bitmap, but saves a step, and patterns can include gradients, etc.


Properties

Colour

The color to use when filling with the brush.

Type:

wx.Colour



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 a GraphicsContext.

Type:

wx.Bitmap



Style

The style of the brush to be used when filling. Currently, wx.BRUSHSTYLE_SOLID and wx.BRUSHSTYLE_STIPPLE are supported.

Type:

wx.BrushStyle