15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CTreeCtrl / CImageList

Derek Bernhart -- derek_bernhart@affymetrix.com
Tuesday, May 07, 1996

 VC++ 4.1 / Win NT 3.51

 How can I create a CTreeCtrl with an image list that contains 
 different sized images?
 According to the documentation on CImageList, images must be 
 same sized.

Derek




Paul Mitchell -- mitchell.p@britishgas.co.uk
Friday, May 10, 1996

[Mini-digest: 2 responses]


> VC++ 4.1 / Win NT 3.51
> 
>  How can I create a CTreeCtrl with an image list that contains 
>  different sized images?
>  According to the documentation on CImageList, images must be 
>  same sized.

> Derek

Yes, images in an Imagelist must be the same size.  If you want to switch
between image sizes (large icons/small icons for example) then you must
create multiple ImageLists and switch between them.

You can't display images of different sizes in a CTreeCtrl at the same
time.

Maybe you'll have to create an ImageList containing images of the largest
size you expect to encounter and render your smaller images into this
size.

Paul Mitchell
British Gas Plc.




-----From: Mark Koehler 

All images must indeed be the same size. If not, the ImageList "control"
will stretch the image to fit. A workaround is to create a memory DC and
bitmap which is the size of a ImageList item. Take the smaller items a
BitBlt them appropriate into the larger sized DC. Then, add this bitmap to
the image list. Make sure that the background of the memory DC is equal to
the transparent color of the ImageList before the BitBlt. 

--
Mark Koehler
Atlanta, GA




| Вернуться в корень Архива |