From 57c26f8210c40317d70d616a05198e042ee9175b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Oct 2004 13:53:33 +0000 Subject: [PATCH] use AlphaBlt() when blitting to a bitmap with alpha channel too (patch 991166) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5a3bbdd0cb..51b2ebb921 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) ) -- 2.45.2