Fix setting alpha flag of wxBitmap created from HBITMAP
If HBITMAP represents 32-bit bitmap we need to check if this is a bitmap with transparency (ARGB) or maybe RGB only (0RBG) and set alpha flag accordingly. Closes #18798.
This commit is contained in:
@@ -1352,6 +1352,7 @@ bool wxBitmap::InitFromHBITMAP(WXHBITMAP bmp, int width, int height, int depth)
|
|||||||
GetBitmapData()->m_width = width;
|
GetBitmapData()->m_width = width;
|
||||||
GetBitmapData()->m_height = height;
|
GetBitmapData()->m_height = height;
|
||||||
GetBitmapData()->m_depth = depth;
|
GetBitmapData()->m_depth = depth;
|
||||||
|
GetBitmapData()->m_hasAlpha = (depth == 32) && CheckAlpha(bmp);
|
||||||
|
|
||||||
return IsOk();
|
return IsOk();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user