]> git.saurik.com Git - wxWidgets.git/commitdiff
use AlphaBlt() when blitting to a bitmap with alpha channel too (patch 991166)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2004 13:53:33 +0000 (13:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Oct 2004 13:53:33 +0000 (13:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dc.cpp

index 5a3bbdd0cbd52309c3a4e94160bc85c5f8a2cc81..51b2ebb921a87ab47af6bba007935d18e79c3612 100644 (file)
@@ -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) )