Poor image quality in ListView
Asked Answered
C

4

6

I'm populating a ListView with items and add images from an ImageList (in the designer). The images, however, are displayed in very poor quality, even though I've set the image size in the ImageList to their original size (16x16). Have a look:

Terrible image quality http://balazsbotond.hu/downloads/listview-icons.png

The original images are beautiful, sharp PNG icons. What can I do?

Cliftonclim answered 24/10, 2009 at 9:34 Comment(0)
C
2

Well, this was pretty easy. Just don't change the image size of the ImageList after adding the images :)

Cliftonclim answered 24/10, 2009 at 10:33 Comment(0)
N
12

Try this line of code.

ImageList1.ColorDepth = ColorDepth.Depth16Bit;
Nonobjective answered 8/7, 2013 at 5:32 Comment(0)
D
4

change the colordepth of your imagesList that you're using for the listview and try a higher colorDepth depending on the PNGs (like Depth32Bit) and you'll see the diffrence .

Disgorge answered 24/10, 2009 at 10:22 Comment(0)
C
2

Well, this was pretty easy. Just don't change the image size of the ImageList after adding the images :)

Cliftonclim answered 24/10, 2009 at 10:33 Comment(0)
D
1

For higher quality of image, we have to use the higher ColorDepth for ImageList. The higher Depth allowed in C# is Depth32Bit

Sample usage is as given below

imgLstPhotos.ColorDepth = ColorDepth.Depth32Bit;

Reference Screenshot:

enter image description here

Defaulter answered 14/11, 2021 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.