Author: cwittich
Date: Wed Apr 18 04:38:36 2007
New Revision: 26385
URL:
http://svn.reactos.org/svn/reactos?rev=26385&view=rev
Log:
take care of DIB_PAL_COLORS in NtGdiStretchDIBits
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Wed Apr 18 04:38:36 2007
@@ -575,6 +575,7 @@
{
HBITMAP hBitmap, hOldBitmap;
HDC hdcMem;
+ HPALETTE hPal = NULL;
if (!Bits || !BitsInfo)
{
@@ -586,6 +587,12 @@
hBitmap = NtGdiCreateCompatibleBitmap(hDC, BitsInfo->bmiHeader.biWidth,
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)
@@ -613,6 +620,9 @@
NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight,
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight -
YSrc,
SrcWidth, SrcHeight, ROP, 0);
+
+ if(hPal)
+ NtGdiSelectPalette(hdcMem, hPal, FALSE);
NtGdiSelectObject(hdcMem, hOldBitmap);
NtGdiDeleteObjectApp(hdcMem);