]> git.saurik.com Git - wxWidgets.git/commitdiff
Ticket #10108 (bitmap from wxImage depth regression)
authorRobert Roebling <robert@roebling.de>
Wed, 22 Oct 2008 16:58:51 +0000 (16:58 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 22 Oct 2008 16:58:51 +0000 (16:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/bitmap.cpp

index 38a27a4092ea368173f2669290152e27ccdafe87..307c67bada721baf44f2500a9b284dde080044a5 100644 (file)
@@ -842,14 +842,16 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
         return false;
 
     const bool hasAlpha = image.HasAlpha();
+    
+    if (depth == -1)
+      depth = dib.GetDepth();
 
     // store the bitmap parameters
     wxBitmapRefData * const refData = new wxBitmapRefData;
     refData->m_width = w;
     refData->m_height = h;
     refData->m_hasAlpha = hasAlpha;
-    refData->m_depth = depth == -1 ? (hasAlpha ? 32 : 24)
-                                   : depth;
+    refData->m_depth = depth;
 
     m_refData = refData;