X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8855e47254a28f5141524b3aaaac03c2944e997..137c8bde085d6d5b7c459902d2ea1a198ab48765:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 2f96e67b5e..af05803527 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Name: bitmap.cpp +// Name: src/msw/bitmap.cpp // Purpose: wxBitmap // Author: Julian Smart // Modified by: @@ -24,6 +24,8 @@ #pragma hdrstop #endif +#include "wx/bitmap.h" + #ifndef WX_PRECOMP #include @@ -32,12 +34,11 @@ #include "wx/app.h" #include "wx/palette.h" #include "wx/dcmemory.h" - #include "wx/bitmap.h" #include "wx/icon.h" + #include "wx/log.h" #endif #include "wx/msw/private.h" -#include "wx/log.h" #if wxUSE_WXDIB #include "wx/msw/dib.h" @@ -476,11 +477,11 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) bool wxBitmap::CreateFromXpm(const char **data) { #if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB - wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") ) + wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") ); wxXPMDecoder decoder; wxImage img = decoder.ReadData(data); - wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ) + wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") ); *this = wxBitmap(img); return true; @@ -780,8 +781,6 @@ wxImage wxBitmap::ConvertToImage() const // wxImage to/from conversions // ---------------------------------------------------------------------------- -#if wxUSE_WXDIB - bool wxBitmap::CreateFromImage(const wxImage& image, int depth) { return CreateFromImage(image, depth, 0); @@ -795,6 +794,8 @@ bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc) return CreateFromImage(image, -1, dc.GetHDC()); } +#if wxUSE_WXDIB + bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc) { wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); @@ -808,8 +809,9 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc) wxDIB dib(image); if ( !dib.IsOk() ) return false; - if (depth == -1) - depth = dib.GetDepth(); // Get depth from image if none specified + + if ( depth == -1 ) + depth = dib.GetDepth(); // Get depth from image if none specified // store the bitmap parameters wxBitmapRefData *refData = new wxBitmapRefData; @@ -973,7 +975,22 @@ wxImage wxBitmap::ConvertToImage() const return image; } -#endif // wxUSE_WXDIB +#else // !wxUSE_WXDIB + +bool +wxBitmap::CreateFromImage(const wxImage& WXUNUSED(image), + int WXUNUSED(depth), + WXHDC WXUNUSED(hdc)) +{ + return false; +} + +wxImage wxBitmap::ConvertToImage() const +{ + return wxImage(); +} + +#endif // wxUSE_WXDIB/!wxUSE_WXDIB #endif // wxUSE_IMAGE