class WXDLLEXPORT wxMask;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxControl;
+class WXDLLEXPORT wxImage;
// ----------------------------------------------------------------------------
// Bitmap data
// 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); }
// we must have this, otherwise icons are silently copied into bitmaps using
// the copy ctor but the resulting bitmap is invalid!
virtual ~wxBitmap();
+ wxImage ConvertToImage() const;
+
// get the given part of bitmap
wxBitmap GetSubBitmap( const wxRect& rect ) const;
wxMask *GetMask() const { return (GetBitmapData() ? GetBitmapData()->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
- 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; }
#if WXWIN_COMPATIBILITY_2
void SetOk(bool isOk);
// creates the bitmap from XPM data, supposed to be called from ctor
bool CreateFromXpm(const char **bits);
+ // creates the bitmap from wxImage, supposed to be called from ctor
+ bool CreateFromImage(const wxImage& image, int depth);
+
private:
#ifdef __WIN32__