Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 449
The Mask Avatar asked Jan 19 '12 17:01

The Mask


1 Answers

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

  • MSDN - Bitmap Class
  • MSDN - Image Class
like image 125
dknaack Avatar answered Sep 24 '22 05:09

dknaack