The wx.Bitmap class encapsulates the concept of a platform-dependent
bitmap. It can be either monochrome or colour, and either loaded from
a file or created dynamically. A bitmap can be selected into a memory
device context (instance of wx.MemoryDC). This enables the bitmap to
be copied to a window or memory device context using wx.DC.Blit, or
to be used as a drawing surface.
The BMP and XMP image file formats are supported on all platforms by
wx.Bitmap. Other formats are automatically loaded by wx.Image and
converted to a wx.Bitmap, so any image file format supported by
wx.Image can be used.
| Method Summary |
| Bitmap |
__init__(self,
name,
type)
|
| |
__del__(self)
|
| bool |
__eq__(self,
other)
|
| bool |
__ne__(self,
other)
|
| |
__nonzero__(self)
|
| |
__repr__(self)
|
| Image |
ConvertToImage(self)
Creates a platform-independent image from a platform-dependent
bitmap. |
| bool |
CopyFromIcon(self,
icon)
|
| int |
GetDepth(self)
Gets the colour depth of the bitmap. |
| int |
GetHeight(self)
Gets the height of the bitmap in pixels. |
| Mask |
GetMask(self)
Gets the associated mask (if any) which may have been loaded from a
file or explpicitly set for the bitmap. |
| Palette |
GetPalette(self)
|
| Size |
GetSize(self)
Get the size of the bitmap. |
| Bitmap |
GetSubBitmap(self,
rect)
Returns a sub-bitmap of the current one as long as the rect belongs
entirely to the bitmap. |
| int |
GetWidth(self)
Gets the width of the bitmap in pixels. |
| bool |
LoadFile(self,
name,
type)
Loads a bitmap from a file. |
| bool |
Ok(self)
|
| bool |
SaveFile(self,
name,
type,
palette)
Saves a bitmap in the named file. |
| |
SetDepth(self,
depth)
Set the depth property (does not affect the existing bitmap data). |
| |
SetHeight(self,
height)
Set the height property (does not affect the existing bitmap data). |
| |
SetMask(self,
mask)
Sets the mask for this bitmap. |
| |
SetMaskColour(self,
colour)
Create a Mask based on a specified colour in the Bitmap. |
| |
SetSize(self,
size)
Set the bitmap size (does not affect the existing bitmap data). |
| |
SetWidth(self,
width)
Set the width property (does not affect the existing bitmap data). |