From 34fd2bc030376d426d1c5d49fedcbe3d259a8a15 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 28 Dec 2020 14:05:56 +0100 Subject: [PATCH] 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. --- src/msw/bitmap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index c789049ef3..1c3486a3e8 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -1352,6 +1352,7 @@ bool wxBitmap::InitFromHBITMAP(WXHBITMAP bmp, int width, int height, int depth) GetBitmapData()->m_width = width; GetBitmapData()->m_height = height; GetBitmapData()->m_depth = depth; + GetBitmapData()->m_hasAlpha = (depth == 32) && CheckAlpha(bmp); return IsOk(); }