comctl32: Use imagelist_copy_images() in ImageList_SetImageCount().

This commit is contained in:
Mike McCormack 2006-11-05 17:09:29 +09:00 committed by Alexandre Julliard
parent 7370fc0e70
commit 1328ca572b
1 changed files with 9 additions and 22 deletions

View File

@ -2613,17 +2613,10 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
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 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
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;