• CImageList图标大小


    CImageList* pImageList = new CImageList();
    pImageList->Create(80,80,ILC_COLORDDB,10,1);
      ///////动态改变
    ImageList_SetIconSize(pImageList->m_hImageList,30,30);


    ////////////////////////////////////////////
    class CImageList
    {
    public:
    HIMAGELIST m_hImageList;
    
    // Constructor
    CImageList(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList)
    { }
    
    // Operators, etc.
    CImageList& operator =(HIMAGELIST hImageList)
    {
    m_hImageList = hImageList;
    return *this;
    }
    
    operator HIMAGELIST() const { return m_hImageList; }
    
    void Attach(HIMAGELIST hImageList)
    {
    ATLASSERT(m_hImageList == NULL);
    ATLASSERT(hImageList != NULL);
    m_hImageList = hImageList;
    }
    
    HIMAGELIST Detach()
    {
    HIMAGELIST hImageList = m_hImageList;
    m_hImageList = NULL;
    return hImageList;
    }
    
    bool IsNull() const { return (m_hImageList == NULL); }
    
    // Attributes
    int GetImageCount() const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetImageCount(m_hImageList);
    }
    
    COLORREF GetBkColor() const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetBkColor(m_hImageList);
    }
    
    COLORREF SetBkColor(COLORREF cr)
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_SetBkColor(m_hImageList, cr);
    }
    
    BOOL GetImageInfo(int nImage, IMAGEINFO* pImageInfo) const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetImageInfo(m_hImageList, nImage, pImageInfo);
    }
    
    HICON GetIcon(int nIndex, UINT uFlags = ILD_NORMAL) const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetIcon(m_hImageList, nIndex, uFlags);
    }
    
    BOOL GetIconSize(int& cx, int& cy) const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetIconSize(m_hImageList, &cx, &cy);
    }
    
    BOOL GetIconSize(SIZE& size) const
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_GetIconSize(m_hImageList, (int*)&size.cx, (int*)&size.cy);
    }
    
    BOOL SetIconSize(int cx, int cy)
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_SetIconSize(m_hImageList, cx, cy);
    }
    
    BOOL SetIconSize(SIZE size)
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_SetIconSize(m_hImageList, size.cx, size.cy);
    }
    
    BOOL SetImageCount(UINT uNewCount)
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_SetImageCount(m_hImageList, uNewCount);
    }
    
    BOOL SetOverlayImage(int nImage, int nOverlay)
    {
    ATLASSERT(m_hImageList != NULL);
    return ImageList_SetOverlayImage(m_hImageList, nImage, nOverlay);
    }




  • 相关阅读:
    12/21
    和寶寶在一起3/10
    11/23
    c#windows应用程序窗体间传值
    用OWC做统计图
    javascript 创建字典
    .NetCom双向数据交换的实现(RecordSet与.Net DataSet的转化)
    JScript 方法 indexOf 方法
    详尽解析window.event对象
    Window.Open详解
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13318771.html
Copyright © 2020-2023  润新知