- 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:
Jérôme Gardou 2010-04-21 15:52:52 +00:00
parent 2250e691f1
commit ef35c1e75c
3 changed files with 8 additions and 10 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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