X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..8bc3617742deb43c011fa91e840cb7a6d3e9b095:/include/wx/msw/bitmap.h?ds=sidebyside diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 7b9820cbb0..85f7b683c5 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -28,6 +28,7 @@ class WXDLLEXPORT wxIcon; class WXDLLEXPORT wxMask; class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxControl; +class WXDLLEXPORT wxImage; // ---------------------------------------------------------------------------- // Bitmap data @@ -82,7 +83,7 @@ public: wxBitmap(char **data) { CreateFromXpm((const char **)data); } // Load a file or resource - wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); + wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); // New constructor for generalised creation from data wxBitmap(void *data, long type, int width, int height, int depth = 1); @@ -90,6 +91,12 @@ public: // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1); +#if wxUSE_IMAGE + // Convert from wxImage: + wxBitmap(const wxImage& image, int depth = -1) + { (void)CreateFromImage(image, depth); } +#endif // wxUSE_IMAGE + // we must have this, otherwise icons are silently copied into bitmaps using // the copy ctor but the resulting bitmap is invalid! wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); } @@ -117,9 +124,13 @@ public: virtual ~wxBitmap(); +#if wxUSE_IMAGE + wxImage ConvertToImage() const; +#endif // wxUSE_IMAGE + // get the given part of bitmap wxBitmap GetSubBitmap( const wxRect& rect ) const; - + // copies the contents and mask of the given (colour) icon to the bitmap bool CopyFromIcon(const wxIcon& icon); @@ -186,6 +197,11 @@ protected: // creates the bitmap from XPM data, supposed to be called from ctor bool CreateFromXpm(const char **bits); +#if wxUSE_IMAGE + // creates the bitmap from wxImage, supposed to be called from ctor + bool CreateFromImage(const wxImage& image, int depth); +#endif // wxUSE_IMAGE + private: #ifdef __WIN32__ // common part of CopyFromIcon/CopyFromCursor for Win32