简体   繁体   中英

Delphi : differant image sizes in listview

is it possible to add differant image sizes in the same listview

for example

adding item with 32pxl icon and 24pxl subitems

thanks in advance

An image list control is constrained such that all images have the same dimensions. I'm assuming that you are using the vsReport view mode, which means that your images will come from the image list attached to the SmallImages property. And so they must all be the same size.

The constraints are not imposed by Delphi. They are a straight reflection of the underlying Windows control. Windows image lists are implemented in a way that means all images are the same size. They are implemented as a rectangular bitmap that contains all images one after the other. And the various images properties of Delphi's list view control simply wrap the common control functionality – see LVM_SETIMAGELIST .

You could place your 24px images into 32px images with a transparent area to increase the size from 24px to 32px. If that doesn't do what you need, then you'll need to paint the images yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM