ListView Icon color depth

  • Thread starter Thread starter scoobydoo
  • Start date Start date
S

scoobydoo

hi,
I have a problem displaying icons at the right colour depthin a
ListView.

I've made an icon file, (using IconWorkshop 5), it has 3 icons within
it. A 32x32 32bpp XP style icon, a 32x32 32bpp non-xp icon (no
transparency), and a 16x16 version.

I add these icons to an ImageList, which is then assigned to the
LargeImageList property of the ListView.

The list view dislays the XP-style icon even on Win2k. I would like to
be able to tell it to display the non-xp version of the icon.

I've tried setting the "ColorDepth" property of the ListView- but it
seems to make no difference.

In Windows File Explorer they display correctly (ie, on win2k it shows
the non-xp icon).

It also seems to slightly distort the image - (it seems to take the XP
icon, and convert its colour depth)- , compared to the Windows
Explorer version.

Any ideas? I'm getting desparate.

Thanks,
David.
 
Hi scoobydoo,

As i remeber, if you want to change color depth of images in
ImageList, then you should set ImageList's ColorDepth before
you add these images.

AFAIK ListView does not have any property like "ColorDepth".

Marcin
 
Hi,
Thank you for your reply.

I meant the ColorDepth property of the ImageList, not the List View, sorry.

The icons are embeeded resources, and are loaded :
Icon myIcon = new Icon(GetType(), "myico.ico");

I set the ImageSize, ColorDepth and Transparency properties of the Imagelist
before adding the icon to it.

Any clues,
TIA,
David
 
Hi David,

Only simple solution i see is:

1. Create a second ImageList with wanted ColorDepth
2. Copy all images from first into a second one.

I didn't test it, so if there will be any proplems
then let me know. Personaly i don't know how it will
work with TransparentColor?

Cheers!

Marcin
 
Back
Top