]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bitmap.cpp
Implemented copy-on-demand for wxClipboard.
[wxWidgets.git] / src / msw / bitmap.cpp
index 7df1437372bf93a48d23aacbaef9f0ee800abf61..dd6423fff72696176bd3e717ae3b81adafac0fad 100644 (file)
@@ -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();
@@ -1187,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() )
@@ -1317,6 +1322,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& dataBase)
         }
     }
 }
+#endif // #ifdef wxHAVE_RAW_BITMAP
 
 // ----------------------------------------------------------------------------
 // wxMask