X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/35bbb0c66bef7bfc43f28ceeac04be41d1ac9efe..1e151594721201f2048aa295dcf35acd28f012b9:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5a3bbdd0cb..c6f000a796 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1911,8 +1911,11 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, WXMICROWIN_CHECK_HDC_RET(false) + // if either the source or destination has alpha channel, we must use + // AlphaBlt() as other function don't handle it correctly const wxBitmap& bmpSrc = source->m_selectedBitmap; - if ( bmpSrc.Ok() && bmpSrc.HasAlpha() ) + if ( bmpSrc.Ok() && (bmpSrc.HasAlpha() || + (m_selectedBitmap.Ok() && m_selectedBitmap.HasAlpha())) ) { if ( AlphaBlt(GetHdc(), xdest, ydest, width, height, GetHdcOf(*source), bmpSrc) ) @@ -2458,6 +2461,7 @@ static bool AlphaBlt(HDC hdcDst, #else // !wxHAVE_RAW_BITMAP // no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose // alpha but at least something will be shown like this) + wxUnusedVar(bmp); return false; #endif // wxHAVE_RAW_BITMAP }