Fix setting transparency flag for wxBitmap created from wxIcon

wxBitmap should be made transparency-capable before copying wxIcon bits to it. Doing so when wxIcon bits are already copied seems to work fine for OSX 10.8, but not for newer versions. 

Closes #17953.
This commit is contained in:
Artur Wieczorek
2017-09-28 19:04:45 +02:00
parent 229c69d891
commit c6938e9f97

View File

@@ -839,13 +839,14 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
if ( Create( w, h ) )
{
// Assume 32 bpp icon has transparency values
UseAlpha(icon.GetDepth() == 32);
wxMemoryDC dc ;
dc.SelectObject( *this ) ;
dc.DrawIcon( icon , 0 , 0 ) ;
dc.SelectObject( wxNullBitmap ) ;
// Assume 32 bpp icon has transparency values
UseAlpha(icon.GetDepth() == 32);
return true;
}