工具栏图标不失真
我把icon直接import进来,然后复制,粘贴到toolBar上,运行,发现图标是失真的,
使用CImageList后就ok了,代码如下:
m_imageList.Create(32,32,ILC_COLOR32|ILC_MASK,4,0);
HICON hIcon;
hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
m_imageList.Add(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON5);
m_imageList.Add(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON6);
m_imageList.Add(hIcon);
hIcon = AfxGetApp()->LoadIcon(IDI_ICON9);
m_imageList.Add(hIcon);
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_imageList);