Mike McCormack : comctl32: Use imagelist_copy_images() in ImageList_SetImageCount().

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 6 05:48:32 CST 2006


Module: wine
Branch: master
Commit: 1328ca572b0a8ca7df702490b9e66c3c59e54df4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1328ca572b0a8ca7df702490b9e66c3c59e54df4

Author: Mike McCormack <mike at codeweavers.com>
Date:   Sun Nov  5 17:09:29 2006 +0900

comctl32: Use imagelist_copy_images() in ImageList_SetImageCount().

---

 dlls/comctl32/imagelist.c |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c
index 58eac98..91dc7a5 100644
--- a/dlls/comctl32/imagelist.c
+++ b/dlls/comctl32/imagelist.c
@@ -2613,17 +2613,10 @@ ImageList_SetImageCount (HIMAGELIST himl
     if (hbmNewBitmap != 0)
     {
         SelectObject (hdcBitmap, hbmNewBitmap);
+        imagelist_copy_images( himl, himl->hdcImage, hdcBitmap, 0, nCopyCount, 0 );
+
+	/* FIXME: delete 'empty' image space? */
 
-	/* copy images */
-        BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
-                himl->hdcImage, 0, 0, SRCCOPY);
-#if 0
-	/* delete 'empty' image space */
-	SetBkColor (hdcBitmap, RGB(255, 255, 255));
-	SetTextColor (hdcBitmap, RGB(0, 0, 0));
-	PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0,
-		  (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
-#endif
         SelectObject (himl->hdcImage, hbmNewBitmap);
 	DeleteObject (himl->hbmImage);
 	himl->hbmImage = hbmNewBitmap;
@@ -2633,22 +2626,16 @@ #endif
 
     if (himl->hbmMask)
     {
-        hbmNewBitmap = CreateBitmap (nNewCount * himl->cx, himl->cy,
-                                       1, 1, NULL);
+        SIZE sz;
+        imagelist_get_bitmap_size( himl, nNewCount, himl->cy, &sz );
+        hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
         if (hbmNewBitmap != 0)
         {
             SelectObject (hdcBitmap, hbmNewBitmap);
+            imagelist_copy_images( himl, himl->hdcMask, hdcBitmap, 0, nCopyCount, 0 );
+
+	    /* FIXME: delete 'empty' image space? */
 
-	    /* copy images */
-            BitBlt (hdcBitmap, 0, 0, nCopyCount * himl->cx, himl->cy,
-                    himl->hdcMask, 0, 0, SRCCOPY);
-#if 0
-	    /* delete 'empty' image space */
-	    SetBkColor (hdcBitmap, RGB(255, 255, 255));
-	    SetTextColor (hdcBitmap, RGB(0, 0, 0));
-            PatBlt (hdcBitmap,  nCopyCount * himl->cx, 0,
-		      (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS);
-#endif
             SelectObject (himl->hdcMask, hbmNewBitmap);
             DeleteObject (himl->hbmMask);
             himl->hbmMask = hbmNewBitmap;




More information about the wine-cvs mailing list