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)
| |
__repr__(self)
| |
Image |
Creates a platform-independent image from a platform-dependent bitmap. |
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 |
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). | |
Inherited from GDIObject | |
bool |
|
bool |
|
| |
Inherited from Object | |
Deletes the C++ object this Python object is a proxy for. | |
String |
Returns the class name of the C++ class using wxRTTI. |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... |
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.
|
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).
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 17:03:32 2007 | http://epydoc.sf.net |