mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
fixing regress of icon drawing copyimage are complete mess and have allot of bugs.
I fixed tempary the icon drawing bug until I or some else got time rewriting copyimage image_load case here is known bugs 1. alpha icon does not working. 2. wrong background getting selected 3. and allot other thing. svn path=/trunk/; revision=27246
This commit is contained in:
parent
ec6a3bd4ea
commit
87c9cac62c
1 changed files with 29 additions and 4 deletions
|
@ -681,21 +681,46 @@ CopyImage(
|
|||
&& bi->bmiColors[1].rgbReserved == 0);
|
||||
}
|
||||
}
|
||||
/*
|
||||
else if (!monochrome)
|
||||
{
|
||||
monochrome = ds.dsBm.bmBitsPixel == 1;
|
||||
}
|
||||
|
||||
*/
|
||||
if (monochrome)
|
||||
{
|
||||
res = CreateBitmap(desiredx, desiredy, 1, 1, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
HDC screenDC = GetDC(NULL);
|
||||
res = CreateCompatibleBitmap(screenDC, desiredx, desiredy);
|
||||
ReleaseDC(NULL, screenDC);
|
||||
/* FIXME This is a tempary fix until we found time to rewrite copyimage */
|
||||
//HDC screenDC = GetDC(NULL); hnd
|
||||
|
||||
HBITMAP hOldBitmapBitmap, hOldBitmapLoad, hbmLoad;
|
||||
HDC hdcImage, hdcBitmap;
|
||||
|
||||
hdcImage = CreateCompatibleDC(0);
|
||||
hdcBitmap = CreateCompatibleDC(0);
|
||||
|
||||
hbmLoad = CreateBitmap (desiredx, desiredy, ds.dsBm.bmPlanes, ds.dsBm.bmBitsPixel, NULL);
|
||||
hOldBitmapBitmap = SelectObject(hdcBitmap, (HBITMAP) hnd);
|
||||
hOldBitmapLoad = SelectObject(hdcImage, hbmLoad);
|
||||
|
||||
/* Copy the user's image */
|
||||
BitBlt (hdcImage, 0, 0, desiredx, desiredy, hdcBitmap, 0, 0, SRCCOPY);
|
||||
|
||||
SelectObject (hdcImage, hOldBitmapLoad);
|
||||
SelectObject (hdcBitmap, hOldBitmapBitmap);
|
||||
DeleteDC (hdcImage);
|
||||
DeleteDC (hdcBitmap);
|
||||
|
||||
return hbmLoad;
|
||||
|
||||
|
||||
//res = CreateCompatibleBitmap(screenDC, desiredx, desiredy);
|
||||
//ReleaseDC(NULL, screenDC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (res)
|
||||
|
|
Loading…
Reference in a new issue