我的代码如下:m_imagelist.Create(16,16,ILC_COLOR16,2,2);//后面两个参数是什么意思?
//设置图标背景色为透明
m_imagelist.SetBkColor(CLR_NONE);
//加载图标
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_TREECLOSE));//载入第一个图标
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON_TREEOPEN));//载入第二个图标
但是这一句没用:m_imagelist.SetBkColor(CLR_NONE);
显示的时候还是有背景色,怎么办?

解决方案 »

  1.   

    不设置m_imagelist.SetBkColor(CLR_NONE);
    CLR_NONE是白色
    后两个参数
    nInitial
        Number of images that the image list initially contains.
    nGrow
        Number of images by which the image list can grow when the system needs to resize the list to make room for new images. This parameter represents the number of new images the resized image list can contain.
      

  2.   

    不设置m_imagelist.SetBkColor(CLR_NONE);
    的话就有背景色,我要的是透明效果!
      

  3.   

    编辑 ICON的时候可以自己画成透明的