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

.. currentmodule:: wx.lib.graphics

.. highlight:: python



.. _wx.lib.graphics.GraphicsBitmap:

==========================================================================================================================================
|phoenix_title|  **wx.lib.graphics.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| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>GraphicsBitmap</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.graphics.GraphicsBitmap_inheritance.png" alt="Inheritance diagram of GraphicsBitmap" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.graphics.GraphicsBitmap.html" title="A GraphicsBitmap is a wrapper around a cairo ImageSurface.  It can" alt="" coords="5,83,225,112"/> <area shape="rect" id="node2" href="wx.lib.graphics.GraphicsObject.html" title="Base class for the other ``Graphics*`` classes." alt="" coords="8,5,223,35"/> </map> 
   </p>

|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.graphics.GraphicsObject`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.graphics.GraphicsBitmap.__init__`                                 Create either a NULL GraphicsBitmap or an empty one if a size is given
:meth:`~wx.lib.graphics.GraphicsBitmap.ConvertToImage`                           Return the contents of this ``GraphicsBitmap`` as a :class:`wx.Image`.
:meth:`~wx.lib.graphics.GraphicsBitmap.CreateFromBitmap`                         Create a GraphicsBitmap from a wx.Bitmap
:meth:`~wx.lib.graphics.GraphicsBitmap.CreateFromBuffer`                         Creates a GraphicsBitmap that uses the given buffer object as
:meth:`~wx.lib.graphics.GraphicsBitmap.CreateFromPNG`                            Create a GraphicsBitmap from a PNG file
:meth:`~wx.lib.graphics.GraphicsBitmap.CreateFromSurface`                        Use an existing cairo ImageSurface as a GraphicsBitmap
:meth:`~wx.lib.graphics.GraphicsBitmap.IsNull`                                   
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.lib.graphics.GraphicsBitmap.Format`                                   The type or format of the Cairo ``Surface``.
:attr:`~wx.lib.graphics.GraphicsBitmap.Height`                                   The height of the bitmap and surface
:attr:`~wx.lib.graphics.GraphicsBitmap.Size`                                     A tuple consisting of the Width and Height
:attr:`~wx.lib.graphics.GraphicsBitmap.Stride`                                   The "stride" of the Cairo ``Surface``, in bytes.
:attr:`~wx.lib.graphics.GraphicsBitmap.Surface`                                  A reference to the Cairo ``Surface`` used for this bitmap.
:attr:`~wx.lib.graphics.GraphicsBitmap.Width`                                    The width of the bitmap and surface
================================================================================ ================================================================================


|


|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


   .. method:: ConvertToImage(self)

      Return the contents of this ``GraphicsBitmap`` as a :class:`wx.Image`.
      
      Currently not implemented...


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

      The type or format of the Cairo ``Surface``.
      Typically ``FORMAT_ARGB32`` or ``FORMAT_RGB24``


   .. attribute:: Height

      The height of the bitmap and surface


   .. attribute:: Size

      A tuple consisting of the Width and Height


   .. attribute:: Stride

      The "stride" of the Cairo ``Surface``, in bytes.
      The stride is the distance in bytes from the beginning of one row
      of the image data to the beginning of the next row.


   .. attribute:: Surface

      A reference to the Cairo ``Surface`` used for this bitmap.


   .. attribute:: Width

      The width of the bitmap and surface


