Don't set alpha flag for wxBitmaps with depth < 32 bpp (wxMSW).

Flag indicating that bitmap contains alpha channel can be set only for 32 bpp bitmap.
This commit is contained in:
Artur Wieczorek
2016-01-17 16:19:52 +01:00
parent 884f3c623d
commit 390091cc24

View File

@@ -1204,7 +1204,13 @@ wxDC *wxBitmap::GetSelectedInto() const
void wxBitmap::UseAlpha(bool use)
{
if ( GetBitmapData() )
{
// Only 32bpp bitmaps can contain alpha channel.
if ( use && GetBitmapData()->m_depth < 32 )
use = false;
GetBitmapData()->m_hasAlpha = use;
}
}
bool wxBitmap::HasAlpha() const