mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
Evgeniy Boltik <bstsoft@narod.ru>
- Use bitmap's DIB palette, if it exists. Fixes problems described in bug 4147. See issue #4147 for more details. svn path=/trunk/; revision=39975
This commit is contained in:
parent
044b06829d
commit
defbc44f67
1 changed files with 11 additions and 3 deletions
|
@ -271,8 +271,17 @@ IntSetDIBits(
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Destination palette obtained from the hDC
|
||||
hDCPalette = PALETTE_LockPalette(((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault);
|
||||
// Use hDIBPalette if it exists
|
||||
if (bitmap->hDIBPalette)
|
||||
{
|
||||
DDB_Palette = bitmap->hDIBPalette;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Destination palette obtained from the hDC
|
||||
DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault;
|
||||
}
|
||||
hDCPalette = PALETTE_LockPalette(DDB_Palette);
|
||||
if (NULL == hDCPalette)
|
||||
{
|
||||
EngUnlockSurface(SourceSurf);
|
||||
|
@ -282,7 +291,6 @@ IntSetDIBits(
|
|||
return 0;
|
||||
}
|
||||
DDB_Palette_Type = hDCPalette->Mode;
|
||||
DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault;
|
||||
PALETTE_UnlockPalette(hDCPalette);
|
||||
|
||||
// Source palette obtained from the BITMAPINFO
|
||||
|
|
Loading…
Reference in a new issue