mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 11:00:55 +00:00
[WIN32K]
- Use the attached surface bits depth when creating a compatible DC [USER32] - use a display DC for loading images svn path=/branches/reactos-yarotows/; revision=46981
This commit is contained in:
parent
2250e691f1
commit
ef35c1e75c
|
@ -491,10 +491,10 @@ LoadBitmapImage(HINSTANCE hInstance, LPCWSTR lpszName, UINT fuLoad)
|
|||
UnmapViewOfFile(BitmapInfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: Handle color conversion and transparency. */
|
||||
|
||||
hScreenDc = CreateCompatibleDC(NULL);
|
||||
hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
||||
if (hScreenDc == NULL)
|
||||
{
|
||||
RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo);
|
||||
|
|
|
@ -140,7 +140,7 @@ CreateIcon(
|
|||
ICONINFO IconInfo;
|
||||
|
||||
IconInfo.fIcon = TRUE;
|
||||
|
||||
|
||||
if (cBitsPixel == 1)
|
||||
{
|
||||
nHeight <<= 1;
|
||||
|
@ -159,7 +159,7 @@ CreateIcon(
|
|||
{
|
||||
IconInfo.hbmColor = CreateBitmap(nWidth, nHeight, cPlanes, cBitsPixel, XORbits);
|
||||
if(!IconInfo.hbmColor)
|
||||
{
|
||||
{
|
||||
DeleteObject(IconInfo.hbmMask);
|
||||
return (HICON)0;
|
||||
}
|
||||
|
@ -260,9 +260,7 @@ CreateIconFromResourceEx(
|
|||
Data = (PBYTE)SafeIconImage + HeaderSize;
|
||||
|
||||
/* get a handle to the screen dc, the icon we create is going to be compatable with this */
|
||||
// FIXME!!! This is a victim of the Win32k Initialization BUG!!!!!
|
||||
//hScreenDc = CreateDCW(NULL, NULL, NULL, NULL);
|
||||
hScreenDc = CreateCompatibleDC(NULL);
|
||||
hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
||||
if (hScreenDc == NULL)
|
||||
{
|
||||
RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage);
|
||||
|
|
|
@ -176,7 +176,7 @@ IntCreateCompatibleBitmap(
|
|||
Bmp = IntGdiCreateBitmap(abs(Width),
|
||||
abs(Height),
|
||||
dibs.dsBm.bmPlanes,
|
||||
Dc->ppdev->gdiinfo.cBitsPixel,//<-- HACK! dibs.dsBm.bmBitsPixel, // <-- Correct!
|
||||
dibs.dsBm.bmBitsPixel,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
|
@ -665,7 +665,7 @@ VOID IntHandleSpecialColorType(HDC hDC, COLORREF* Color)
|
|||
switch (*Color >> 24)
|
||||
{
|
||||
case 0x10: /* DIBINDEX */
|
||||
if (IntGetDIBColorTable(hDC, LOWORD(*Color), 1, &quad) == 1)
|
||||
if (IntGetDIBColorTable(hDC, LOWORD(*Color), 1, &quad) == 1)
|
||||
{
|
||||
*Color = RGB(quad.rgbRed, quad.rgbGreen, quad.rgbBlue);
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ VOID IntHandleSpecialColorType(HDC hDC, COLORREF* Color)
|
|||
default:
|
||||
DPRINT("Unsupported color type %d passed\n", *Color >> 24);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
|
|
Loading…
Reference in a new issue