X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68be9f090f422450d333385cf62c9b4d350674be..159b66c02a8f1c724d1af3c768ad5d90f4c8a0e2:/include/wx/motif/bitmap.h?ds=sidebyside diff --git a/include/wx/motif/bitmap.h b/include/wx/motif/bitmap.h index c673a408fa..785509cb69 100644 --- a/include/wx/motif/bitmap.h +++ b/include/wx/motif/bitmap.h @@ -27,6 +27,7 @@ class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxBitmapHandler; class WXDLLEXPORT wxIcon; class WXDLLEXPORT wxCursor; +class WXDLLEXPORT wxImage; // A mask is a mono bitmap used for drawing bitmaps // transparently. @@ -155,6 +156,10 @@ public: // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1); + + // Convert from wxImage: + wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); } + ~wxBitmap(); virtual bool Create(int width, int height, int depth = -1); @@ -164,6 +169,8 @@ public: virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); + + wxImage ConvertToImage() const; bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); } int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); } @@ -183,8 +190,8 @@ public: void SetMask(wxMask *mask) ; wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } - bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; } - bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; } + bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; } + bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } // Format handling static wxList& GetHandlers() { return sm_handlers; } @@ -212,6 +219,7 @@ protected: protected: bool CreateFromXpm(const char **bits); + bool CreateFromImage(const wxImage& image, int depth); }; // Creates a bitmap with transparent areas drawn in