CImageList and icons
Ken Culley -- KCULLEY@CSI.compuserve.com Wednesday, March 27, 1996 I am adding icons to a CImageList. The icon files each contain a 16x16 version with no 32x32 version currently in the file. My question is, how do I specify which icon size to use when I call CImageList::Draw()? Draw() seems to be using the 32x32 version (which doesn't exist in the file) and, therefore, draws nothing. If I copy the 16x16 version to the 32x32 version in the icon file, the icon draws OK (but is being scaled to the size of my drawing region). Obviously, copying the 16x16 versions to the 32x32 versions will work but I would like to understand how CImageList determines what to draw (also, I would like to avoid having to manually edit over 70 icon files!). I presume there must be a way since CListCtrl uses CImageLists and offers the ability to render either the 16x16 or 32x32 versions via the LVSIL_NORMAL/LVSIL_SMALL flags on the CListCtrl::SetImageList() function. Any help you can offer is appreciated. Ken Culley
Gareth Evans-McClave -- gareth@ndl.co.uk Monday, April 01, 1996 I am adding icons to a CImageList. The icon files each contain a 16x16 version with no 32x32 version currently in the file. My question is, how do I specify which icon size to use when I call CImageList::Draw()? Draw() seems to be using the 32x32 version (which doesn't exist in the file) and, therefore, draws nothing. If I copy the 16x16 version to the 32x32 version in the icon file, the icon draws OK (but is being scaled to the size of my drawing region). Obviously, copying the 16x16 versions to the 32x32 versions will work but I would like to understand how CImageList determines what to draw (also, I would like to avoid having to manually edit over 70 icon files!). I presume there must be a way since CListCtrl uses CImageLists and offers the ability to render either the 16x16 or 32x32 versions via the LVSIL_NORMAL/LVSIL_SMALL flags on the CListCtrl::SetImageList() function. =========================== I have noticed this effect too; Applications using small icons work fine under Win95, but the listview uses (or attempts to use) the large icons when run under NT or Win32s. Are small icons supported on these other platforms? by the way you didnt mention your environment but I would guess NT :-) The only way around this that we have found is to have large and small versions of all the icons! Gareth
| Вернуться в корень Архива |