From b9b1f368fe78f4f52dd355faf9f7c0672659697d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2004 15:02:54 +0000 Subject: [PATCH] respect xsrc, ysrc parameters in DoBlit() (patch 733961) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index d8cc34d86e..0dc13d5a1f 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -2065,10 +2065,19 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, { StretchBltModeChanger changeMode(GetHdc(), COLORONCOLOR); + // Figure out what co-ordinate system we're supposed to specify + // ysrc in. + const LONG hDIB = ds.dsBmih.biHeight; + if ( hDIB > 0 ) + { + // reflect ysrc + ysrc = hDIB - (ysrc + height); + } + if ( ::StretchDIBits(GetHdc(), xdest, ydest, width, height, - 0, 0, + xsrc, ysrc, width, height, ds.dsBm.bmBits, (LPBITMAPINFO)&ds.dsBmih, -- 2.50.0