Ticket #10108 (bitmap from wxImage depth regression)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-10-22 16:58:51 +00:00
parent 78f2d746a0
commit bf7160a83e

View 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;