mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 16:18:43 +00:00
take care of DIB_PAL_COLORS in NtGdiStretchDIBits
svn path=/trunk/; revision=26385
This commit is contained in:
parent
d2796783e0
commit
1f00c50b85
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue