.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.graphics .. highlight:: python .. _wx.lib.graphics.GraphicsBrush: ========================================================================================================================================== |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 :class:`wx.Bitmap`, or a Cairo ``Pattern`` object. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class GraphicsBrush:
| |super_classes| Known Superclasses ================================== :class:`wx.lib.graphics.GraphicsObject` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.lib.graphics.GraphicsBrush.__init__` Create a new ``GraphicsBrush``. :meth:`~wx.lib.graphics.GraphicsBrush.Apply` Apply this brush's properties to the given context. :meth:`~wx.lib.graphics.GraphicsBrush.CreateFromBrush` Converts a :class:`wx.Brush` to a ``GraphicsBrush``. :meth:`~wx.lib.graphics.GraphicsBrush.CreateFromPattern` Create a ``GraphicsBrush`` directly from a Cairo ``Pattern`` object. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.lib.graphics.GraphicsBrush.Colour` The color to use when filling with the brush. :attr:`~wx.lib.graphics.GraphicsBrush.Pattern` A pattern to be used when filling with this brush. :attr:`~wx.lib.graphics.GraphicsBrush.Stipple` The Stipple is a bitmap to be used as a pattern when filling with this brush. :attr:`~wx.lib.graphics.GraphicsBrush.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 :class:`wx.Bitmap`, or a Cairo ``Pattern`` object. .. method:: __init__(self, colour=wx.BLACK, style=wx.BRUSHSTYLE_SOLID) Create a new ``GraphicsBrush``. .. method:: Apply(self, ctx) Apply this brush's properties to the given context. Called by :class:`GraphicsContext` as needed. .. staticmethod:: CreateFromBrush(brush) Converts a :class:`wx.Brush` to a ``GraphicsBrush``. .. staticmethod:: 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. .. attribute:: Colour The color to use when filling with the brush. :type: :class:`wx.Colour` .. attribute:: Pattern A pattern to be used when filling with this brush. :type: Cairo ``Pattern`` .. attribute:: 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 :class:`GraphicsContext`. :type: :class:`wx.Bitmap` .. attribute:: Style The style of the brush to be used when filling. Currently, ``wx.BRUSHSTYLE_SOLID`` and ``wx.BRUSHSTYLE_STIPPLE`` are supported. :type: :ref:`wx.BrushStyle`