1

I am including an icon image in my Resources folder and retrieving it via

System.Drawing.Icon icon1= CreateDesktopShortCut.Properties.Resources.Treetog_I_Documents;

However After retrieving the icon I want to store the icon to a path in Hard Drive. Any idea how to do it?

leppie
  • 115,091
  • 17
  • 196
  • 297
DChamp
  • 73
  • 1
  • 5
  • Ad: company I work for provides search engine to look for answers on C# questions about saving icons to a file - try it out https://www.bing.com/search?q=c%23+save+icon+file – Alexei Levenkov Jun 01 '16 at 16:51

1 Answers1

2

You can use the icon's Save() method and a FileStream:

icon1.Save(new FileStream("c:\\myicon.ico", FileMode.Create));
René Vogt
  • 43,056
  • 14
  • 77
  • 99