mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 08:52:57 +00:00
take care of DIB_PAL_COLORS in NtGdiStretchDIBits
svn path=/trunk/; revision=26385
This commit is contained in:
parent
d2796783e0
commit
1f00c50b85
1 changed files with 10 additions and 0 deletions
|
@ -575,6 +575,7 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
|
||||||
{
|
{
|
||||||
HBITMAP hBitmap, hOldBitmap;
|
HBITMAP hBitmap, hOldBitmap;
|
||||||
HDC hdcMem;
|
HDC hdcMem;
|
||||||
|
HPALETTE hPal = NULL;
|
||||||
|
|
||||||
if (!Bits || !BitsInfo)
|
if (!Bits || !BitsInfo)
|
||||||
{
|
{
|
||||||
|
@ -587,6 +588,12 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
|
||||||
BitsInfo->bmiHeader.biHeight);
|
BitsInfo->bmiHeader.biHeight);
|
||||||
hOldBitmap = NtGdiSelectObject(hdcMem, hBitmap);
|
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 ||
|
if (BitsInfo->bmiHeader.biCompression == BI_RLE4 ||
|
||||||
BitsInfo->bmiHeader.biCompression == BI_RLE8)
|
BitsInfo->bmiHeader.biCompression == BI_RLE8)
|
||||||
{
|
{
|
||||||
|
@ -614,6 +621,9 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
|
||||||
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
|
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
|
||||||
SrcWidth, SrcHeight, ROP, 0);
|
SrcWidth, SrcHeight, ROP, 0);
|
||||||
|
|
||||||
|
if(hPal)
|
||||||
|
NtGdiSelectPalette(hdcMem, hPal, FALSE);
|
||||||
|
|
||||||
NtGdiSelectObject(hdcMem, hOldBitmap);
|
NtGdiSelectObject(hdcMem, hOldBitmap);
|
||||||
NtGdiDeleteObjectApp(hdcMem);
|
NtGdiDeleteObjectApp(hdcMem);
|
||||||
NtGdiDeleteObject(hBitmap);
|
NtGdiDeleteObject(hBitmap);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue