3
Reply

Icon extraction

Peter

Peter

Oct 24 2008 9:11 AM
4.3k

Hi.

Iwould like to extract an icon from an .exe file. currently I am doing it like this:

System.Drawing.Icon ico = System.Drawing.Icon.ExtractAssociatedIcon(exePath);
MemoryStream Memo = new MemoryStream();
ico.Save(Memo);
FileStream fs = System.IO.File.OpenWrite(icoOutputPath);
fs.Write(Memo.GetBuffer(), 0, (
int)Memo.Position);
fs.Close();

I works fine, but the quality of the icon is very bad. The colors are not the same as the ones on the .exe file.
Any ideas on how to preserve the quality?

Thanks in advance.
Peter


Answers (3)
Next Recommended Forum