Ticket #10108 (bitmap from wxImage depth regression)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-10-22 17:01:02 +00:00
parent dd66ebf62f
commit e5bafa71da

View File

@@ -813,13 +813,15 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
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;