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:
@@ -813,13 +813,15 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
|
|||||||
|
|
||||||
const bool hasAlpha = image.HasAlpha();
|
const bool hasAlpha = image.HasAlpha();
|
||||||
|
|
||||||
|
if (depth == -1)
|
||||||
|
depth = dib.GetDepth();
|
||||||
|
|
||||||
// store the bitmap parameters
|
// store the bitmap parameters
|
||||||
wxBitmapRefData * const refData = new wxBitmapRefData;
|
wxBitmapRefData * const refData = new wxBitmapRefData;
|
||||||
refData->m_width = w;
|
refData->m_width = w;
|
||||||
refData->m_height = h;
|
refData->m_height = h;
|
||||||
refData->m_hasAlpha = hasAlpha;
|
refData->m_hasAlpha = hasAlpha;
|
||||||
refData->m_depth = depth == -1 ? (hasAlpha ? 32 : 24)
|
refData->m_depth = depth;
|
||||||
: depth;
|
|
||||||
|
|
||||||
m_refData = refData;
|
m_refData = refData;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user