m_editFont.CreatePointFont(160, "宋體");
SetFont(&m_editFont);
CImageList m_Imagelist;
CBitmap bitmap;
m_Imagelist.Create(32, 32, ILC_COLOR24, 2, 1);
bitmap.LoadBitmap(IDB_BITMAP11);
CRect rect;
GetClientRect(&rect);
ptheList = &GetListCtrl();
ptheList->ModifyStyle(0, LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SORTASCENDING);
ptheList->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
ptheList->SetImageList(&m_Imagelist, LVSIL_SMALL);
ptheList->InsertColumn(0, "默認筆記", LVCFMT_LEFT, rect.Width(), 0);
int pos;
pos = ptheList->InsertItem(1, "123", 0);
pos = ptheList->InsertItem(2, "321", 0);
}
這樣運行出來的圖標是空白的。。調試發現 m_Imagelist 和 bitmap 都沒有成功把位圖加載進去。。為什麼。。是哪裡錯了?
imagelist是否加載bitmap成功了沒,圖片資源需要能符合格式