X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9bcaf117a45df3088e6cfad17941585dcbef3a5..b8d24d4edd1f91339918134d2420af39c324aa1f:/src/msw/bitmap.cpp?ds=sidebyside diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 1cccec1980..dd6423fff7 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -50,7 +50,9 @@ #include "wx/image.h" #include "wx/xpmdecod.h" +#ifdef wxHAVE_RAW_BITMAP #include "wx/rawbmp.h" +#endif // missing from mingw32 header #ifndef CLR_INVALID @@ -788,7 +790,9 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc ) HBITMAP hbitmap; // are we going to use DIB? - if ( wxShouldCreateDIB(w, h, depth, hdc) ) + // + // NB: DDBs don't support alpha so if we have alpha channel we must use DIB + if ( image.HasAlpha() || wxShouldCreateDIB(w, h, depth, hdc) ) { // don't delete the DIB section in dib object dtor hbitmap = dib.Detach(); @@ -1090,11 +1094,13 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const // wxBitmap accessors // ---------------------------------------------------------------------------- +#if wxUSE_PALETTE wxPalette* wxBitmap::GetPalette() const { return GetBitmapData() ? &GetBitmapData()->m_bitmapPalette : (wxPalette *) NULL; } +#endif wxMask *wxBitmap::GetMask() const { @@ -1185,6 +1191,7 @@ void wxBitmap::SetQuality(int WXUNUSED(quality)) // raw bitmap access support // ---------------------------------------------------------------------------- +#ifdef wxHAVE_RAW_BITMAP void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { if ( !Ok() ) @@ -1315,6 +1322,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) } } } +#endif // #ifdef wxHAVE_RAW_BITMAP // ---------------------------------------------------------------------------- // wxMask