Manipulation d'une CImageList
Bonjour,
J'ai besoin d'afficher des thumbnails dans une liste.
Voici mon code qui pour l'instant est censé afficher une simple image :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| CBitmap *bmp1;
CxImage image;
CString bmpPath;
bmpPath.Format(file_name);
bmpPath.Format("%s.bmp",bmpPath.Left(bmpPath.ReverseFind('.')));
bmpPath = GetFilePath(bmpPath.GetBuffer(bmpPath.GetLength()));
image.Load(bmpPath.GetBuffer(bmpPath.GetLength()), CXIMAGE_FORMAT_BMP);
HBITMAP handlebitmap = NULL;
handlebitmap = image.MakeBitmap(m_ListFiles.GetDC()->m_hDC);
bmp1 = bmp1->FromHandle(handlebitmap);
CImageList imageList;
imageList.Create(105,143,ILC_COLOR16,1,5);
int imgP=imageList.Add(bmp1,RGB(0,0,0));
m_ListFiles.SetImageList(&imageList,LVSIL_STATE); |
Tout semble bien se dérouler depuis le débogueur (imageList.Add renvoie bien 0), cependant l'image n'apparait pas dans la liste.
Je n'arrive pas à trouver la source du problème.
Faut-il obligatoirement travailler avec une liste vierge, ou ayant certaines caractéristiques spéciales permettant l'insertion d'une imageList ?
Y'a-t-il une fonction qui m'a échappé qui force l'affichage ?
J'ai lu dans une discussion que la classe CImageList contenait des bugs, qu'en pensez vous ?
Merci d'avance pour vos suggestions.