Icon in ImageList back to a USABLE Icon format...

S

Steph.

Hi,



I load Icons in an ImageList.To do that I have to convert the Icons in the Bitmap format.



But HOW can I get My Icon back in a Usable Icon format ?



I tried the code below, but the Icons are drawn in a black square. (no more transparent color on the edges of the icons.)



Icon MyIcon = Icon.FromHandle((imgList.Images[position] as Bitmap).GetHicon());





Thanks for any help !



Steph.
 
L

Larry Lard

Steph. said:
Hi,

I load Icons in an ImageList.To do that I have to convert the Icons in the Bitmap format.

But HOW can I get My Icon back in a Usable Icon format ?

I tried the code below, but the Icons are drawn in a black square. (no more transparent color on the edges of the icons.)

Icon MyIcon = Icon.FromHandle((imgList.Images[position] as Bitmap).GetHicon());

Thanks for any help !

I don't know for sure, but I think you're out of luck. The ImageList
(as its name suggests) holds Images - an Icon isn't an Image, so when
you convert an Icon to an Image, you lose information.

Maybe you can separately keep a collection of your Icons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top