.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2017 by Total Control Software License: wxWindows License .. include:: headings.inc .. module:: wx.lib.graphics .. currentmodule:: wx.lib.graphics .. highlight:: python .. _wx.lib.graphics: ========================================================================================================================================== |phoenix_title| **wx.lib.graphics** ========================================================================================================================================== This module implements an API similar to :class:`wx.GraphicsContext` and its related classes. In this case the implementation for all platforms is done using Cairo, via the :mod:`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 ``wx.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. .. note:: It is possible to write code using this module that is **not** compatible with :class:`wx.GraphicsContext` code, because, you know, this is Python and it is lots more flexible and powerful. However the intent is that the reverse will not be true, that code compatible with ``wx.GraphicsContext`` will (mostly) work when using these classes instead. Care should be taken when modifying this module so that the compatibility is maintained. |function_summary| Functions Summary ==================================== ================================================================================ ================================================================================ :func:`~wx.lib.graphics.Property` ================================================================================ ================================================================================ | |class_summary| Classes Summary =============================== ================================================================================ ================================================================================ `~wx.lib.graphics._OffsetHelper` A helper used by the context class. `~wx.lib.graphics.GraphicsBitmap` A GraphicsBitmap is a wrapper around a cairo ImageSurface. It can `~wx.lib.graphics.GraphicsBrush` A ``GraphicsBrush`` is used to define how fills are painted. `~wx.lib.graphics.GraphicsContext` The GraphicsContext is the object which facilitates drawing to a surface. `~wx.lib.graphics.GraphicsFont` A ``GraphicsFont`` is an adapter to allow using :class:`wx.Font` with a `~wx.lib.graphics.GraphicsGradientStop` This class represents a single color-stop in a gradient brush. The `~wx.lib.graphics.GraphicsGradientStops` An ordered collection of gradient color stops `~wx.lib.graphics.GraphicsMatrix` A matrix holds an affine transformations, such as a scale, `~wx.lib.graphics.GraphicsObject` Base class for the other ``Graphics*`` classes. `~wx.lib.graphics.GraphicsPath` A GraphicsPath is a representation of a geometric path, essentially `~wx.lib.graphics.GraphicsPen` A ``GraphicsPen`` is used to define the properties of how a stroke is drawn. ================================================================================ ================================================================================ | .. toctree:: :maxdepth: 1 :hidden: wx.lib.graphics._OffsetHelper wx.lib.graphics.GraphicsBitmap wx.lib.graphics.GraphicsBrush wx.lib.graphics.GraphicsContext wx.lib.graphics.GraphicsFont wx.lib.graphics.GraphicsGradientStop wx.lib.graphics.GraphicsGradientStops wx.lib.graphics.GraphicsMatrix wx.lib.graphics.GraphicsObject wx.lib.graphics.GraphicsPath wx.lib.graphics.GraphicsPen Functions ------------ .. function:: Property( function )