Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[TreeCtrl]CTreeLis於Item前塞入圖示

這邊找到的方法是使用CImageList來實作。要注意的是,這邊宣告的CImageList要為Data member,否則會無法顯示圖示。

這邊使用的Icon為BitMap,建立的圖形長度為16bits。
因此在CImageList::Create()要輸入的cx值為16。

建立好CImageList後,再把把他透過CTreeList::SetItemImage()塞給所要使用的CTreeList即可。

程式碼如下:
header
 ....  
 CImageList m_cImageList;  
 ....  

CPP:
     if ( !m_cImageList.Create(IDB_BMP_ICON, 16, 2, RGB(0, 0, 0)) ) {  
         CDSMsgShower::ShowMsgByErrorBox(this->m_hWnd, "ACCERT", MB_OK, "Fail to create image list."); };  
   
     this->m_treEnvItems.SetImageList(&m_cImageList, TVSIL_NORMAL);  
   
     ....  
     this->m_treEnvItems.SetItemImage(hEnvItemsTree, 0, 1);  

如圖形無法顯示,有可能是輸入的bitmap長度有錯。

Comments

  1. Sorry for that I may not be able to read your comment. Would you mind to comment again in English? thanks

    ReplyDelete

Post a Comment

Popular Posts