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:
@@ -1204,7 +1204,13 @@ wxDC *wxBitmap::GetSelectedInto() const
|
|||||||
void wxBitmap::UseAlpha(bool use)
|
void wxBitmap::UseAlpha(bool use)
|
||||||
{
|
{
|
||||||
if ( GetBitmapData() )
|
if ( GetBitmapData() )
|
||||||
|
{
|
||||||
|
// Only 32bpp bitmaps can contain alpha channel.
|
||||||
|
if ( use && GetBitmapData()->m_depth < 32 )
|
||||||
|
use = false;
|
||||||
|
|
||||||
GetBitmapData()->m_hasAlpha = use;
|
GetBitmapData()->m_hasAlpha = use;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxBitmap::HasAlpha() const
|
bool wxBitmap::HasAlpha() const
|
||||||
|
Reference in New Issue
Block a user