how can I convert System.Drawing.Icon to System.Drawing.Image?

The Mask picture The Mask · Jan 19, 2012 · Viewed 39.8k times · Source

I'm getting icon from another application using this:

Icon IEIcon =  Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\iexplore.exe");

how to convert it to System.Drawing.Image?

Answer

dknaack picture dknaack · Jan 19, 2012

Description

The Bitmap is derived from Image so you can use Icon's .ToBitmap() method.

Sample

Icon IEIcon = Icon.ExtractAssociatedIcon(@"C:\Program Files\Internet Explorer\iexplore.exe");
Image im = IEIcon.ToBitmap();

More Information