gdi32: Properly handle SetDIBits failure in StretchDIBits.

This commit is contained in:
Alexandre Julliard 2008-03-10 17:21:33 +01:00
parent 66386eb46d
commit 5953a86ab1

View File

@ -290,13 +290,13 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
dwRop );
}
SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
heightSrc = SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
/* Origin for DIBitmap may be bottom left (positive biHeight) or top
left (negative biHeight) */
StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
hdcMem, xSrc, abs(height) - heightSrc - ySrc,
widthSrc, heightSrc, dwRop );
if (heightSrc) StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
hdcMem, xSrc, abs(height) - heightSrc - ySrc,
widthSrc, heightSrc, dwRop );
if(hpal)
SelectPalette(hdcMem, hpal, FALSE);
SelectObject( hdcMem, hOldBitmap );