X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb0054cda81e7a6a6e1f33f4b47e46f529110f14..3c87527e89228b537800d06e1c32a62900417beb:/utils/wxPython/src/gdi.i diff --git a/utils/wxPython/src/gdi.i b/utils/wxPython/src/gdi.i index 05a5de9351..ba3a8aa788 100644 --- a/utils/wxPython/src/gdi.i +++ b/utils/wxPython/src/gdi.i @@ -61,6 +61,11 @@ public: %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1); wxBitmap* wxNoRefBitmap(char* name, long flags); +#ifdef __WXMSW__ +%new wxBitmap* wxBitmapFromData(char* data, long type, + int width, int height, int depth = 1); +#endif + %{ // Alternate 'constructor' wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) { return new wxBitmap(width, height, depth); @@ -73,6 +78,13 @@ wxBitmap* wxNoRefBitmap(char* name, long flags); wxBitmap* wxNoRefBitmap(char* name, long flags) { return new wxBitmap(name, flags); } + +#ifdef __WXMSW__ + wxBitmap* wxBitmapFromData(char* data, long type, + int width, int height, int depth = 1) { + return new wxBitmap((void*)data, type, width, height, depth); + } +#endif %} //--------------------------------------------------------------------------- @@ -96,10 +108,8 @@ public: class wxIcon : public wxBitmap { public: -#ifdef __WXMSW__ wxIcon(const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); -#endif ~wxIcon(); int GetDepth(); @@ -112,6 +122,7 @@ public: void SetWidth(int width); }; + //--------------------------------------------------------------------------- class wxCursor : public wxBitmap { @@ -348,8 +359,10 @@ public: void DrawBitmap(wxBitmap& bitmap, long x, long y, bool swapPalette=TRUE) { wxMemoryDC* memDC = new wxMemoryDC; memDC->SelectObject(bitmap); +#ifdef __WXMSW__ if (swapPalette) self->SetPalette(*bitmap.GetPalette()); +#endif self->Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), memDC, 0, 0, self->GetLogicalFunction()); memDC->SelectObject(wxNullBitmap);