diff --git a/include/wx/msw/dib.h b/include/wx/msw/dib.h index d9e5745ee3..c85c9e9d2c 100644 --- a/include/wx/msw/dib.h +++ b/include/wx/msw/dib.h @@ -53,7 +53,7 @@ public: // same as the corresponding ctors but with return value bool Create(int width, int height, int depth); - bool Create(const wxBitmap& bmp); + bool Create(const wxBitmap& bmp) { return Create(GetHbitmapOf(bmp)); } bool Create(HBITMAP hbmp); bool Load(const wxString& filename); diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index d6d127a340..45986e70ad 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -137,18 +137,10 @@ bool wxDIB::Create(int width, int height, int depth) return true; } -bool wxDIB::Create(const wxBitmap& bmp) -{ - wxCHECK_MSG( bmp.Ok(), false, wxT("wxDIB::Create(): invalid bitmap") ); - - if ( !Create(GetHbitmapOf(bmp)) ) - return false; - - return true; -} - bool wxDIB::Create(HBITMAP hbmp) { + wxCHECK_MSG( hbmp, false, wxT("wxDIB::Create(): invalid bitmap") ); + // this bitmap could already be a DIB section in which case we don't need // to convert it to DIB DIBSECTION ds;