Commit f97bf3e6 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

comctl32: imagelist: Remove more 1xN assumptions.

parent 5f89960a
...@@ -2548,8 +2548,9 @@ ImageList_SetIconSize (HIMAGELIST himl, INT cx, INT cy) ...@@ -2548,8 +2548,9 @@ ImageList_SetIconSize (HIMAGELIST himl, INT cx, INT cy)
himl->hbmImage = hbmNew; himl->hbmImage = hbmNew;
if (himl->hbmMask) { if (himl->hbmMask) {
hbmNew = CreateBitmap (himl->cMaxImage * himl->cx, himl->cy, SIZE sz;
1, 1, NULL); imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
hbmNew = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
SelectObject (himl->hdcMask, hbmNew); SelectObject (himl->hdcMask, hbmNew);
DeleteObject (himl->hbmMask); DeleteObject (himl->hbmMask);
himl->hbmMask = hbmNew; himl->hbmMask = hbmNew;
...@@ -2847,7 +2848,9 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT ...@@ -2847,7 +2848,9 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT
{ {
HBITMAP hbmNewBitmap; HBITMAP hbmNewBitmap;
UINT ilc = (himl->flags & 0xFE); UINT ilc = (himl->flags & 0xFE);
UINT width = count * himl->cx; SIZE sz;
imagelist_get_bitmap_size( himl, count, height, &sz );
if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR) if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR)
{ {
...@@ -2884,8 +2887,8 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT ...@@ -2884,8 +2887,8 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT
} }
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi->bmiHeader.biWidth = width; bmi->bmiHeader.biWidth = sz.cx;
bmi->bmiHeader.biHeight = height; bmi->bmiHeader.biHeight = sz.cy;
bmi->bmiHeader.biPlanes = 1; bmi->bmiHeader.biPlanes = 1;
bmi->bmiHeader.biBitCount = himl->uBitsPixel; bmi->bmiHeader.biBitCount = himl->uBitsPixel;
bmi->bmiHeader.biCompression = BI_RGB; bmi->bmiHeader.biCompression = BI_RGB;
...@@ -2903,7 +2906,7 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT ...@@ -2903,7 +2906,7 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT
{ {
TRACE("Creating Bitmap: %d Bits per Pixel\n", himl->uBitsPixel); TRACE("Creating Bitmap: %d Bits per Pixel\n", himl->uBitsPixel);
hbmNewBitmap = CreateBitmap (width, height, 1, himl->uBitsPixel, NULL); hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, himl->uBitsPixel, NULL);
} }
TRACE("returning %p\n", hbmNewBitmap); TRACE("returning %p\n", hbmNewBitmap);
return hbmNewBitmap; return hbmNewBitmap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment