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¶
Known Superclasses¶
wx.lib.graphics.GraphicsObject
Methods Summary¶
Create either a NULL GraphicsBitmap or an empty one if a size is given |
|
Return the contents of this |
|
Create a GraphicsBitmap from a wx.Bitmap |
|
Creates a GraphicsBitmap that uses the given buffer object as |
|
Create a GraphicsBitmap from a PNG file |
|
Use an existing cairo ImageSurface as a GraphicsBitmap |
|
Returns whether the object is valid. |
Properties Summary¶
The type or format of the Cairo |
|
The height of the bitmap and surface |
|
A tuple consisting of the Width and Height |
|
The “stride” of the Cairo |
|
A reference to the Cairo |
|
The width of the bitmap and surface |
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 awx.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)¶
Returns whether the object is valid.
Properties¶
- Format¶
The type or format of the Cairo
Surface
. TypicallyFORMAT_ARGB32
orFORMAT_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