Home | Trees | Index | Help |
|
---|
Package wx :: Class Bitmap |
|
object
--+ |Object
--+ |GDIObject
--+ | Bitmap
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.
See Also:
wx.EmptyBitmap
, wx.BitmapFromIcon
, wx.BitmapFromImage
,
wx.BitmapFromXPMData
, wx.BitmapFromBits
, wx.BitmapFromBuffer
,
wx.BitmapFromBufferRGBA
, wx.Image
To Do:
Add wrappers and support for raw bitmap data access. Can this be be put into Python without losing the speed benefits of the teplates and iterators in rawbmp.h?
Find a way to do very efficient PIL Image <--> wx.Bitmap converstions.
Method Summary | |
---|---|
Bitmap |
|
__del__(self)
| |
bool | __eq__(self,
other)
|
bool | __ne__(self,
other)
|
__nonzero__(self)
| |
Image |
Creates a platform-independent image from a platform-dependent bitmap. |
Copy data from a RGB buffer object to replace the bitmap pixel data. | |
Copy data from a RGBA buffer object to replace the bitmap pixel data. | |
bool | CopyFromIcon(self,
icon)
|
int |
Gets the colour depth of the bitmap. |
int |
Gets the height of the bitmap in pixels. |
Mask |
Gets the associated mask (if any) which may have been loaded from a file or explpicitly set for the bitmap. |
Palette | GetPalette(self)
|
Size |
Get the size of the bitmap. |
Bitmap |
Returns a sub-bitmap of the current one as long as the rect belongs entirely to the bitmap. |
int |
Gets the width of the bitmap in pixels. |
bool | IsOk(self)
|
bool |
Loads a bitmap from a file. |
bool | Ok(self)
|
bool |
Saves a bitmap in the named file. |
Set the depth property (does not affect the existing bitmap data). | |
Set the height property (does not affect the existing bitmap data). | |
Sets the mask for this bitmap. | |
Create a Mask based on a specified colour in the Bitmap. | |
Set the bitmap size (does not affect the existing bitmap data). | |
Set the width property (does not affect the existing bitmap data). |
Property Summary | |
---|---|
Depth : See GetDepth and SetDepth | |
Height : See GetHeight and SetHeight | |
Mask : See GetMask and SetMask | |
Palette : See GetPalette | |
Size : See GetSize and SetSize | |
SubBitmap : See GetSubBitmap | |
thisown : The membership flag | |
Width : See GetWidth and SetWidth |
Method Details |
---|
__init__(self,
name,
type=BITMAP_TYPE_ANY)
|
ConvertToImage(self)Creates a platform-independent image from a platform-dependent bitmap. This preserves mask information so that bitmaps and images can be converted back and forth without loss in that respect.
|
CopyFromBuffer(self, data)Copy data from a RGB buffer object to replace the bitmap pixel data.
See
|
CopyFromBufferRGBA(self, data)Copy data from a RGBA buffer object to replace the bitmap pixel data.
See
|
GetDepth(self)Gets the colour depth of the bitmap. A value of 1 indicates a monochrome bitmap.
|
GetHeight(self)Gets the height of the bitmap in pixels.
|
GetMask(self)Gets the associated mask (if any) which may have been loaded from a file or explpicitly set for the bitmap. |
GetSize(self)Get the size of the bitmap.
|
GetSubBitmap(self, rect)Returns a sub-bitmap of the current one as long as the rect belongs entirely to the bitmap. This function preserves bit depth and mask information.
|
GetWidth(self)Gets the width of the bitmap in pixels.
|
LoadFile(self, name, type)Loads a bitmap from a file. See
|
SaveFile(self, name, type, palette=None)Saves a bitmap in the named file. See
|
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).
|
Property Details |
---|
Depth |
Height |
Mask |
PaletteSee
|
Size |
SubBitmapSee
|
thisownThe membership flag |
Width |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:26 2007 | http://epydoc.sf.net |