From bb54c6569d4141259df2cf3cb41b57a5fdfa81fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Oct 2014 12:57:00 +0000 Subject: [PATCH] Don't replace bitmap transparency with black when converting to icon in wxMSW. This was a wrong workaround for incorrect drawing of the icons elsewhere and isn't needed if the destination is first AND-ed with the mask, as it should be. See #16512. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/bitmap.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 7ff59d3bc3..f724ee7001 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -1908,21 +1908,6 @@ HICON wxBitmapToIconOrCursor(const wxBitmap& bmp, iconInfo.hbmMask = hbmpMask; iconInfo.hbmColor = GetHbitmapOf(bmp); - // black out the transparent area to preserve background colour, because - // Windows blits the original bitmap using SRCINVERT (XOR) after applying - // the mask to the dest rect. - { - MemoryHDC dcSrc, dcDst; - SelectInHDC selectMask(dcSrc, (HBITMAP)mask->GetMaskBitmap()), - selectBitmap(dcDst, iconInfo.hbmColor); - - if ( !::BitBlt(dcDst, 0, 0, bmp.GetWidth(), bmp.GetHeight(), - dcSrc, 0, 0, SRCAND) ) - { - wxLogLastError(wxT("BitBlt")); - } - } - HICON hicon = ::CreateIconIndirect(&iconInfo); if ( !bmp.GetMask() && !bmp.HasAlpha() )