copy alpha presence flag when copying bitmaps using DIBs (#9883)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-09-03 20:45:52 +00:00
parent fac938f8fd
commit c7639882c1

View File

@@ -264,23 +264,25 @@ wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const
// course (except in !wxUSE_WXDIB), but is completely illogical // course (except in !wxUSE_WXDIB), but is completely illogical
wxBitmap *self = wx_const_cast(wxBitmap *, this); wxBitmap *self = wx_const_cast(wxBitmap *, this);
wxBitmapRefData *selfdata;
#if wxUSE_WXDIB #if wxUSE_WXDIB
// copy the other bitmap // copy the other bitmap
if ( data->m_hBitmap ) if ( data->m_hBitmap )
{ {
wxDIB dib((HBITMAP)(data->m_hBitmap)); wxDIB dib((HBITMAP)(data->m_hBitmap));
self->CopyFromDIB(dib); self->CopyFromDIB(dib);
selfdata = wx_static_cast(wxBitmapRefData *, m_refData);
selfdata->m_hasAlpha = data->m_hasAlpha;
} }
else else
#endif // wxUSE_WXDIB #endif // wxUSE_WXDIB
{ {
// copy the bitmap data // copy the bitmap data
self->m_refData = new wxBitmapRefData(*data); selfdata = new wxBitmapRefData(*data);
self->m_refData = selfdata;
} }
wxBitmapRefData * const
selfdata = wx_static_cast(wxBitmapRefData *, m_refData);
// copy also the mask // copy also the mask
wxMask * const maskSrc = data->GetMask(); wxMask * const maskSrc = data->GetMask();
if ( maskSrc ) if ( maskSrc )