take care of DIB_PAL_COLORS in NtGdiStretchDIBits

svn path=/trunk/; revision=26385
This commit is contained in:
Christoph von Wittich 2007-04-18 00:38:36 +00:00
parent d2796783e0
commit 1f00c50b85

View file

@ -575,6 +575,7 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
{
HBITMAP hBitmap, hOldBitmap;
HDC hdcMem;
HPALETTE hPal = NULL;
if (!Bits || !BitsInfo)
{
@ -587,6 +588,12 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
BitsInfo->bmiHeader.biHeight);
hOldBitmap = NtGdiSelectObject(hdcMem, hBitmap);
if(Usage == DIB_PAL_COLORS)
{
hPal = NtGdiGetCurrentObject(hDC, OBJ_PAL);
hPal = NtGdiSelectPalette(hdcMem, hPal, FALSE);
}
if (BitsInfo->bmiHeader.biCompression == BI_RLE4 ||
BitsInfo->bmiHeader.biCompression == BI_RLE8)
{
@ -614,6 +621,9 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
SrcWidth, SrcHeight, ROP, 0);
if(hPal)
NtGdiSelectPalette(hdcMem, hPal, FALSE);
NtGdiSelectObject(hdcMem, hOldBitmap);
NtGdiDeleteObjectApp(hdcMem);
NtGdiDeleteObject(hBitmap);