The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
like this:
m_pIconImageList = new CImageList;
m_pIconImageList->Create( IDB_ICONS , 16 , 1 , RGB(255,0,255) );
m_tree.SetImageList( m_pIconImageList, TVSIL_NORMAL );
where IDB_ICONS is the resource id of you icon bitmap, and RGB(255,0,255) is the transparent color - in this case pink.
Then when inserting items in the tree control do:
m_tree.InsertItem( "SomeNode" , 0 , 1 );
The 0 is the unselected image, and the 1 is the selected image for the node.
A great way to draw good icons is to use a vector based graphics program. I used openoffice's draw. Then when done, I zoom in close to the icon (mabe around 300x300 pixels, not important as long as it is quite big) and take a screenshot. The icon is then resized to 16x16 in a graphics program, I use irfanview. The resizing gives you nice small smooth looking icons which are difficult to draw by hand.