I'm not sure why I'm getting this black outline when I add an icon to the CListCtrl (or list-view control)?
I load it as such:
//HICON hIcon;
LoadIconWithScaleDown(theApp.m_hInstance, MAKEINTRESOURCE(Icon_ID), 15, 15, &hIcon);
I then create my image list as such:
//CImageList iml;
iml.Create(15, 15, ILC_COLOR32, numberIcons, 0);
iml.Add(hIcon);
the list view is prepped first:
//CListCtrl lst;
lst.SetExtendedStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT |
LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_SUBITEMIMAGES);
lst.ModifyStyle(0, LVS_SHOWSELALWAYS);
and the icon is displayed in the subitem of the list as such:
int nInd = lst.InsertItem(c, L"Main label");
lst.SetItem(nInd, nSubitemIndex, LVIF_TEXT | LVIF_IMAGE, L"2 files", nIconInd, 0, 0, 0);
So what am I doing wrong?
PS. I ran this test on my Windows 8.1 with a 32-bit trucolor display setting.
The icon itself though is a 256-color image since I don't see any reason to waste space on a 32-bit icon with an alpha channel for such a small size & simple design:
LVS_EX_FULLROWSELECT
has transparency issues on XP, you are likely encountering that. You may have to owner-draw the images onto the list view to preserve the transparency. Or, load the images into one image list, then render a copy of the images with a background color matching the list view's color to a separate image list, and then use the second image list with the list view.