0

When displayed either on Button or on ListView, 32-bit images in a 32-bit ImageList are not displayed correctly. There are some black translucent pixels on the edge of the pictures (which have Alpha channel like PNG).

Also, pictures are damaged and quality is downgraded with lines over them (like when you resize a picture without resampling it).

Inserted images are in 32-bit quality and have same dimensions as ImageList images.

I tried to put same images on Button by using Resources files and that works, but for ListView, I have to use ImageList -- which don't works well.

Is there memory leaks or known issues related to 32-bit ImageList?

slugster
  • 49,403
  • 14
  • 95
  • 145
Velcro
  • 546
  • 1
  • 8
  • 27

2 Answers2

0

This problem only happens when you import (32-bit 16x16) ICO file. If you import a 32-bit 16x16 PNG file, there is no issue.

Now you known!

Velcro
  • 546
  • 1
  • 8
  • 27
  • Hmmm, maybe not! See message posted by dls2004 here: https://connect.microsoft.com/VisualStudio/feedback/details/428868/png-files-corrupted-in-an-imagelist-when-opening-and-closing-a-form – Velcro Sep 05 '11 at 16:56
0

I'm with the comment by Velcro..seems to be a problem with the 32 bit System.Drawing dll.

I had the same issue (terrible thumbnail quality on 32 bit systems), and it turned out that it wasn't the Listview control, but with our thumbNail generation. We dropped in the code provided in this SO answer: resizing-an-image-in-asp-net-without-losing-the-image-quality and it worked great!

I'm attributing this to a problem with System.Drawing because we were initially letting the listview do the scaling for us. Our second attempt at fixing the problem was using the open source ImageListView control. That also had the exact same problem and it still uses System.Drawing to generate the thumbs.

We then tried manually generating thumbs in a generic manner (still with System.Drawing) and it was still broken. Finally decided to play with the options for resizing (the above solution) and that solved it.

Community
  • 1
  • 1
scaryman
  • 1,880
  • 1
  • 19
  • 30