comctl32: Fixed handling of monochrome icons in image lists.
This commit is contained in:
parent
e3b5610825
commit
a4c9d96aca
@ -2291,8 +2291,6 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ii.hbmColor == 0)
|
|
||||||
ERR("no color!\n");
|
|
||||||
ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
|
ret = GetObjectW (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ERR("couldn't get mask bitmap info\n");
|
ERR("couldn't get mask bitmap info\n");
|
||||||
@ -2317,18 +2315,32 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
|
|||||||
if (hdcImage == 0)
|
if (hdcImage == 0)
|
||||||
ERR("invalid hdcImage!\n");
|
ERR("invalid hdcImage!\n");
|
||||||
|
|
||||||
|
imagelist_point_from_index(himl, nIndex, &pt);
|
||||||
|
|
||||||
SetTextColor(himl->hdcImage, RGB(0,0,0));
|
SetTextColor(himl->hdcImage, RGB(0,0,0));
|
||||||
SetBkColor (himl->hdcImage, RGB(255,255,255));
|
SetBkColor (himl->hdcImage, RGB(255,255,255));
|
||||||
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
|
|
||||||
|
|
||||||
imagelist_point_from_index(himl, nIndex, &pt);
|
if (ii.hbmColor)
|
||||||
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
|
{
|
||||||
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
|
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
|
||||||
|
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
|
||||||
if (himl->hbmMask) {
|
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
|
||||||
SelectObject (hdcImage, ii.hbmMask);
|
if (himl->hbmMask)
|
||||||
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
|
{
|
||||||
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
|
SelectObject (hdcImage, ii.hbmMask);
|
||||||
|
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
|
||||||
|
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UINT height = bmp.bmHeight / 2;
|
||||||
|
hbmOldSrc = SelectObject (hdcImage, ii.hbmMask);
|
||||||
|
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
|
||||||
|
hdcImage, 0, height, bmp.bmWidth, height, SRCCOPY);
|
||||||
|
if (himl->hbmMask)
|
||||||
|
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
|
||||||
|
hdcImage, 0, 0, bmp.bmWidth, height, SRCCOPY);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectObject (hdcImage, hbmOldSrc);
|
SelectObject (hdcImage, hbmOldSrc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user