Author: greatlrd
Date: Wed Jun 20 23:54:22 2007
New Revision: 27246
URL:
http://svn.reactos.org/svn/reactos?rev=27246&view=rev
Log:
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.
Modified:
trunk/reactos/dll/win32/user32/windows/bitmap.c
Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/bitmap.c (original)
+++ trunk/reactos/dll/win32/user32/windows/bitmap.c Wed Jun 20 23:54:22 2007
@@ -681,21 +681,46 @@
&& 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)