- hdcMem = NtGdiCreateCompatibleDC(hDC);
-
- RtlCopyMemory(pvBits, safeBits, cjMaxBits);
- hOldBitmap = NtGdiSelectBitmap(hdcMem, hBitmap);
-
- /* Origin for DIBitmap may be bottom left (positive biHeight) or top
- left (negative biHeight) */
- ret = NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight,
- hdcMem, XSrc, abs(height) - SrcHeight - YSrc,
- SrcWidth, SrcHeight, ROP, 0);
-
- if(ret)
- ret = SrcHeight;
- NtGdiSelectBitmap(hdcMem, hOldBitmap);
- NtGdiDeleteObjectApp(hdcMem);
- GreDeleteObject(hBitmap);
+ /* Calculate source and destination rect */
+ rcSrc.left = xSrc;
+ rcSrc.top = ySrc;
+ rcSrc.right = xSrc + abs(cxSrc);
+ rcSrc.bottom = ySrc + abs(cySrc);
+ rcDst.left = xDst;
+ rcDst.top = yDst;
+ rcDst.right = rcDst.left + cxDst;
+ rcDst.bottom = rcDst.top + cyDst;
+ IntLPtoDP(pdc, (POINTL*)&rcDst, 2);
+ RECTL_vOffsetRect(&rcDst, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y);