.. include:: headings.inc .. _GraphicsBitmap: ========================================================================================================================================== |phoenix_title| **GraphicsBitmap** ========================================================================================================================================== Represents a bitmap. The objects of this class are not created directly but only via :ref:`GraphicsContext` or :ref:`GraphicsRenderer` CreateBitmap(), CreateBitmapFromImage() or CreateSubBitmap() methods. They can subsequently be used with :meth:`GraphicsContext.DrawBitmap` . The only other operation is testing for the bitmap validity which can be performed using :meth:`~GraphicsBitmap.IsNull` method inherited from the base class. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **GraphicsBitmap** .. raw:: html

Inheritance diagram of GraphicsBitmap

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~GraphicsBitmap.__init__` Default constructor creates an invalid bitmap. :meth:`~GraphicsBitmap.ConvertToImage` Return the contents of this bitmap as :ref:`Image`. :meth:`~GraphicsBitmap.GetNativeBitmap` Return the pointer to the native bitmap data. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~GraphicsBitmap.NativeBitmap` See :meth:`~GraphicsBitmap.GetNativeBitmap` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: GraphicsBitmap(GraphicsObject) Represents a bitmap. **Possible constructors**:: GraphicsBitmap() .. method:: __init__(self) Default constructor creates an invalid bitmap. .. method:: ConvertToImage(self) Return the contents of this bitmap as :ref:`Image`. Using this method is more efficient than converting :ref:`GraphicsBitmap` to :ref:`Bitmap` first and then to :ref:`Image` and can be useful if, for example, you want to save :ref:`GraphicsBitmap` as a disk file in a format not directly supported by :ref:`Bitmap`. Invalid image is returned if the bitmap is invalid. :rtype: :ref:`Image` .. versionadded:: 2.9.3 .. method:: GetNativeBitmap(self) Return the pointer to the native bitmap data. (CGImageRef for Core Graphics, cairo_surface_t for Cairo, Bitmap for GDI+.) .. versionadded:: 2.9.4 .. attribute:: NativeBitmap See :meth:`~GraphicsBitmap.GetNativeBitmap`