Phoenix Logo

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

Inheritance diagram for class GraphicsBitmap:


method_summary Methods Summary

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

property_summary Properties Summary

Format The type or format of the Cairo Surface.
Height The height of the bitmap and surface
Size A tuple consisting of the Width and Height
Stride The “stride” of the Cairo Surface, in bytes.
Surface A reference to the Cairo Surface used for this bitmap.
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.


Methods



__init__(self, width=-1, height=-1, format=FORMAT_ARGB32)

Create either a NULL GraphicsBitmap or an empty one if a size is given



ConvertToImage(self)

Return the contents of this GraphicsBitmap as a wx.Image.

Currently not implemented...



static CreateFromBitmap(bitmap)

Create a GraphicsBitmap from a wx.Bitmap



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



static CreateFromPNG(filename)

Create a GraphicsBitmap from a PNG file



static CreateFromSurface(surface)

Use an existing cairo ImageSurface as a GraphicsBitmap



IsNull(self)

Properties



Format

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



Height

The height of the bitmap and surface



Size

A tuple consisting of the Width and Height



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.



Surface

A reference to the Cairo Surface used for this bitmap.



Width

The width of the bitmap and surface