[VC++][MFC] CImageList 에서 (CListCtrl) 256 이상 색상의 이미지 사용 하기

뭐.... 알아두면 유용할지도..

  1. int nWidth = 64;  
  2. int nHeight = 64;  
  3. int nInitial = 5;  
  4. int nGrow = 0;  
  5.   
  6. CListCtrl listControl;  
  7. CImageList imgList;  
  8. CBitmap bmp;  
  9.   
  10. bmp.LoadBitmap(IDB_BMP_RESOURCE);  
  11.   
  12. imgList.Create(nWidth, nHeight, ILC_MASK | ILC_COLORDDB, nInitial, nGrow);  
  13. imgList.Add(&bmp, RGB(255, 255, 255) /* Mask Color */);  
  14.   
  15. listControl.SetImageList(&imgList, LVSIL_NORMAL);  
  16. listControl.SetIconSpacing(64, 92); /* Icon 들간 간격 */  
  17.   
  18. listControl.InsertItem(Item Number, Text Name, Image Number);