Setting a non-standard size image

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.


Although icons always have to be a square, the images
we use in the list view control does not. For instance, the following code
will create images that are 62 pixels wide. The height of the image will
be the same as the bitmap height in the resource.

m_img.Create( IDB_CUSTOMBITMAP, 62, 1, (COLORREF)-1 );  
m_listctrl.SetImageList( &m_img, LVSIL_SMALL );

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read