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.
+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
");
+MustHaveApp(wxBitmap);
+
class wxBitmap : public wxGDIObject
{
public:
DocCtorStr(
wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY),
- "Loads a bitmap from a file.
-
-:param name: Name of the file to load the bitmap from.
-:param type: The type of image to expect. Can be one of the following
- constants (assuming that the neccessary `wx.Image` handlers are
- loaded):
+ "Loads a bitmap from a file.",
+ "
+ :param name: Name of the file to load the bitmap from.
+ :param type: The type of image to expect. Can be one of the following
+ constants (assuming that the neccessary `wx.Image` handlers are
+ loaded):
* wx.BITMAP_TYPE_ANY
* wx.BITMAP_TYPE_BMP
wxBitmap(int width, int height, int depth=-1),
"Creates a new bitmap of the given size. A depth of -1 indicates the
depth of the current screen or visual. Some platforms only support 1
-for monochrome and -1 for the current colour setting.",
+for monochrome and -1 for the current colour setting.", "",
EmptyBitmap);
DocCtorStrName(
wxBitmap(const wxIcon& icon),
- "Create a new bitmap from a `wx.Icon` object.",
+ "Create a new bitmap from a `wx.Icon` object.", "",
BitmapFromIcon);
DocCtorStrName(
actually display a `wx.Image` as you cannot draw an image directly on
a window. The resulting bitmap will use the provided colour depth (or
that of the current screen colour depth if depth is -1) which entails
-that a colour reduction may have to take place.",
+that a colour reduction may have to take place.", "",
BitmapFromImage);
%extend {
DocStr(wxBitmap(PyObject* listOfStrings),
- "Construct a Bitmap from a list of strings formatted as XPM data.");
- %name(BitmapFromXPMData) wxBitmap(PyObject* listOfStrings) {
+ "Construct a Bitmap from a list of strings formatted as XPM data.", "");
+
+ %RenameCtor(BitmapFromXPMData, wxBitmap(PyObject* listOfStrings))
+ {
char** cArray = NULL;
wxBitmap* bmp;
"Creates a bitmap from an array of bits. You should only use this
function for monochrome bitmaps (depth 1) in portable programs: in
this case the bits parameter should contain an XBM image. For other
-bit depths, the behaviour is platform dependent.");
- %name(BitmapFromBits) wxBitmap(PyObject* bits, int width, int height, int depth=1 ) {
+bit depths, the behaviour is platform dependent.", "");
+
+ %RenameCtor(BitmapFromBits, wxBitmap(PyObject* bits, int width, int height, int depth=1 ))
+ {
char* buf;
int length;
PyString_AsStringAndSize(bits, &buf, &length);
}
-#ifdef __WXMSW__
- void SetPalette(wxPalette& palette);
-#endif
-
// wxGDIImage methods
#ifdef __WXMSW__
long GetHandle();
DocDeclStr(
int , GetWidth(),
- "Gets the width of the bitmap in pixels.");
+ "Gets the width of the bitmap in pixels.", "");
DocDeclStr(
int , GetHeight(),
- "Gets the height of the bitmap in pixels.");
+ "Gets the height of the bitmap in pixels.", "");
DocDeclStr(
int , GetDepth(),
"Gets the colour depth of the bitmap. A value of 1 indicates a
-monochrome bitmap.");
+monochrome bitmap.", "");
%extend {
- DocStr(GetSize, "Get the size of the bitmap.");
+ DocStr(GetSize, "Get the size of the bitmap.", "");
wxSize GetSize() {
wxSize size(self->GetWidth(), self->GetHeight());
return size;
virtual wxImage , ConvertToImage() const,
"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.");
+be converted back and forth without loss in that respect.", "");
DocDeclStr(
file or explpicitly set for the bitmap.
:see: `SetMask`, `wx.Mask`
-");
+", "");
DocDeclStr(
"Sets the mask for this bitmap.
:see: `GetMask`, `wx.Mask`
-");
+", "");
%extend {
DocStr(SetMaskColour,
- "Create a Mask based on a specified colour in the Bitmap.");
+ "Create a Mask based on a specified colour in the Bitmap.", "");
void SetMaskColour(const wxColour& colour) {
wxMask *mask = new wxMask(*self, colour);
self->SetMask(mask);
virtual wxBitmap , GetSubBitmap(const wxRect& rect) const,
"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.");
+information.", "");
DocDeclStr(
virtual bool , SaveFile(const wxString &name, wxBitmapType type,
wxPalette *palette = NULL),
"Saves a bitmap in the named file. See `__init__` for a description of
-the ``type`` parameter.");
+the ``type`` parameter.", "");
DocDeclStr(
virtual bool , LoadFile(const wxString &name, wxBitmapType type),
"Loads a bitmap from a file. See `__init__` for a description of the
-``type`` parameter.");
+``type`` parameter.", "");
-#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const;
+#ifdef __WXMSW__
virtual void SetPalette(const wxPalette& palette);
#endif
DocDeclStr(
virtual void , SetHeight(int height),
- "Set the height property (does not affect the existing bitmap data).");
+ "Set the height property (does not affect the existing bitmap data).", "");
DocDeclStr(
virtual void , SetWidth(int width),
- "Set the width property (does not affect the existing bitmap data).");
+ "Set the width property (does not affect the existing bitmap data).", "");
DocDeclStr(
virtual void , SetDepth(int depth),
- "Set the depth property (does not affect the existing bitmap data).");
+ "Set the depth property (does not affect the existing bitmap data).", "");
%extend {
- DocStr(SetSize, "Set the bitmap size (does not affect the existing bitmap data).");
+ DocStr(SetSize, "Set the bitmap size (does not affect the existing bitmap data).", "");
void SetSize(const wxSize& size) {
self->SetWidth(size.x);
self->SetHeight(size.y);
%pythoncode { def __nonzero__(self): return self.Ok() }
%extend {
- bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : False; }
- bool __ne__(const wxBitmap* other) { return other ? (*self != *other) : True; }
+ bool __eq__(const wxBitmap* other) { return other ? (*self == *other) : false; }
+ bool __ne__(const wxBitmap* other) { return other ? (*self != *other) : true; }
}
};
A mask may be associated with a `wx.Bitmap`. It is used in
`wx.DC.DrawBitmap` or `wx.DC.Blit` when the source device context is a
`wx.MemoryDC` with a `wx.Bitmap` selected into it that contains a
-mask.
-");
+mask.", "");
+
+MustHaveApp(wxMask);
class wxMask : public wxObject {
public:
portions of the mask. If no ``colour`` or an invalid ``colour`` is
passed then BLACK is used.
-:see: `wx.Bitmap`, `wx.Colour`");
+:see: `wx.Bitmap`, `wx.Colour`", "");
%extend {
wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) {