.. include:: headings.inc .. module:: lib.graphics .. currentmodule:: lib.graphics .. highlight:: python .. _lib.graphics: ========================================================================================================================================== |phoenix_title| **graphics** ========================================================================================================================================== This module implements an API similar to wx.GraphicsContext and the related classes. In this case the implementation for all platforms is done using Cairo, via the wx.lib.wxcairo glue module. Why do this? Why not just use wx.GraphicsContext everywhere? Using Cairo on every platform enables us to more easily be totally consistent on all platforms. Implementing it in Python means that it is easy to fill in the gaps in functionality with features of Cairo that GraphicsContext may not provide, like converting text to a path, using compositing operators, or being able to provide an implementation for things like context.Clear(). Why not just use Cairo directly? There may be times when you do want to use wx.GrpahicsContext, so being able to share code between that and this implementation is nice. Also, I like the class hierarchy and API exposed by the wx.GraphicsContext classes a little better than Cairo's. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for module **graphics** .. raw:: html

Inheritance diagram of graphics

| |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~lib.graphics.Property` ================================================================================ ================================================================================ | |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ :ref:`lib.graphics._OffsetHelper` :ref:`lib.graphics.GraphicsBitmap` A GraphicsBitmap is a wrapper around a cairo ImageSurface. It can :ref:`lib.graphics.GraphicsBrush` A Brush is used to define how fills are painted. They can have :ref:`lib.graphics.GraphicsContext` The GraphicsContext is the object which facilitates drawing to a surface. :ref:`lib.graphics.GraphicsFont` :ref:`lib.graphics.GraphicsGradientStop` This class represents a single color-stop in a gradient brush. The :ref:`lib.graphics.GraphicsGradientStops` An ordered collection of gradient color stops for a gradient brush. There :ref:`lib.graphics.GraphicsMatrix` A matrix holds an affine transformations, such as a scale, :ref:`lib.graphics.GraphicsObject` :ref:`lib.graphics.GraphicsPath` A GraphicsPath is a representaion of a geometric path, essentially :ref:`lib.graphics.GraphicsPen` A Pen is used to define the properties of how a stroke is drawn. ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: lib.graphics._OffsetHelper lib.graphics.GraphicsBitmap lib.graphics.GraphicsBrush lib.graphics.GraphicsContext lib.graphics.GraphicsFont lib.graphics.GraphicsGradientStop lib.graphics.GraphicsGradientStops lib.graphics.GraphicsMatrix lib.graphics.GraphicsObject lib.graphics.GraphicsPath lib.graphics.GraphicsPen Functions ------------ .. function:: Property( function )