mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
take care of DIB_PAL_COLORS in NtGdiStretchDIBits
svn path=/trunk/; revision=26385
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user