X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e86f2cc84aabc8a58b1984c1ed7fb9475f6abe67..152a58083fbe9ad9ff15f41472e0a2fdf9f73fb3:/include/wx/msw/bitmap.h diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 7525ca1b3f..ce3e841aee 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -25,7 +25,6 @@ class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxDIB; #endif class WXDLLIMPEXP_FWD_CORE wxIcon; -class WXDLLIMPEXP_FWD_CORE wxImage; class WXDLLIMPEXP_FWD_CORE wxMask; class WXDLLIMPEXP_FWD_CORE wxPalette; class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; @@ -44,7 +43,7 @@ enum wxBitmapTransparency // NOTE: for wxMSW we don't use the wxBitmapBase base class declared in bitmap.h! // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBitmap : public wxGDIImage +class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage { public: // default ctor creates an invalid bitmap, you must Create() it later @@ -58,12 +57,12 @@ public: #ifdef wxNEEDS_CHARPP wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); // New constructor for generalised creation from data wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1); @@ -73,7 +72,8 @@ public: // // NB: this ctor will create a DIB for 24 and 32bpp bitmaps, use ctor // taking a DC argument if you want to force using DDB in this case - wxBitmap(int width, int height, int depth = -1); + wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); } + wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); } // Create a bitmap compatible with the given DC wxBitmap(int width, int height, const wxDC& dc); @@ -114,13 +114,14 @@ public: #if wxUSE_IMAGE wxImage ConvertToImage() const; + wxBitmap ConvertToDisabled(unsigned char brightness = 255) const; #endif // wxUSE_IMAGE // get the given part of bitmap wxBitmap GetSubBitmap( const wxRect& rect ) const; // NB: This should not be called from user code. It is for wx internal - // use only. + // use only. wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const; // copies the contents and mask of the given (colour) icon to the bitmap @@ -137,9 +138,12 @@ public: #endif virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH); + virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) + { return Create(sz.GetWidth(), sz.GetHeight(), depth); } + virtual bool Create(int width, int height, const wxDC& dc); virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; wxBitmapRefData *GetBitmapData() const @@ -170,10 +174,8 @@ public: void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); } WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); } -#ifdef __WXDEBUG__ void SetSelectedInto(wxDC *dc); wxDC *GetSelectedInto() const; -#endif // __WXDEBUG__ protected: virtual wxGDIImageRefData *CreateData() const; @@ -207,7 +209,7 @@ private: // wxMask: a mono bitmap used for drawing bitmaps transparently. // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMask : public wxObject +class WXDLLIMPEXP_CORE wxMask : public wxObject { public: wxMask(); @@ -251,7 +253,7 @@ protected: // NOTE: for wxMSW we don't use the wxBitmapHandler class declared in bitmap.h! // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxBitmapHandler : public wxGDIImageHandler +class WXDLLIMPEXP_CORE wxBitmapHandler : public wxGDIImageHandler { public: wxBitmapHandler() { }