.. include:: headings.inc .. currentmodule:: lib.graphics .. highlight:: python .. _lib.graphics.GraphicsBitmap: ========================================================================================================================================== |phoenix_title| **GraphicsBitmap** ========================================================================================================================================== A GraphicsBitmap is a wrapper around a cairo ImageSurface. It can be used as a source for drawing images, or as a target of drawing operations. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **GraphicsBitmap** .. raw:: html

Inheritance diagram of GraphicsBitmap

| |super_classes| Known Superclasses ================================== :class:`lib.graphics.GraphicsObject` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~lib.graphics.GraphicsBitmap.__init__` Create either a NULL GraphicsBitmap or an empty one if a size is given :meth:`~lib.graphics.GraphicsBitmap.CreateFromBitmap` Create a GraphicsBitmap from a wx.Bitmap :meth:`~lib.graphics.GraphicsBitmap.CreateFromBuffer` Creates a GraphicsBitmap that uses the given buffer object as :meth:`~lib.graphics.GraphicsBitmap.CreateFromPNG` Create a GraphicsBitmap from a PNG file :meth:`~lib.graphics.GraphicsBitmap.CreateFromSurface` Use an existing cairo ImageSurface as a GraphicsBitmap :meth:`~lib.graphics.GraphicsBitmap.IsNull` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~lib.graphics.GraphicsBitmap.Format` :attr:`~lib.graphics.GraphicsBitmap.Height` :attr:`~lib.graphics.GraphicsBitmap.Size` :attr:`~lib.graphics.GraphicsBitmap.Stride` :attr:`~lib.graphics.GraphicsBitmap.Surface` :attr:`~lib.graphics.GraphicsBitmap.Width` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: GraphicsBitmap(GraphicsObject) A GraphicsBitmap is a wrapper around a cairo ImageSurface. It can be used as a source for drawing images, or as a target of drawing operations. .. method:: __init__(self, width=-1, height=-1, format=FORMAT_ARGB32) Create either a NULL GraphicsBitmap or an empty one if a size is given .. staticmethod:: CreateFromBitmap(bitmap) Create a GraphicsBitmap from a wx.Bitmap .. staticmethod:: CreateFromBuffer(buffer, width, height, format=FORMAT_ARGB32, stride=-1) Creates a GraphicsBitmap that uses the given buffer object as the pixel storage. This means that the current contents of the buffer will be the initial state of the bitmap, and anything drawn to this surface will be stored in the given buffer. .. staticmethod:: CreateFromPNG(filename) Create a GraphicsBitmap from a PNG file .. staticmethod:: CreateFromSurface(surface) Use an existing cairo ImageSurface as a GraphicsBitmap .. method:: IsNull(self) .. attribute:: Format See :meth:`~GraphicsBitmap.fget` .. attribute:: Height See :meth:`~GraphicsBitmap.fget` .. attribute:: Size See :meth:`~GraphicsBitmap.fget` .. attribute:: Stride See :meth:`~GraphicsBitmap.fget` .. attribute:: Surface See :meth:`~GraphicsBitmap.fget` .. attribute:: Width See :meth:`~GraphicsBitmap.fget`