static void DumpInfo(string path) { ICOFile ico = ICOFile.ReadFromFile(path, false); foreach (ICOImage img in ico.Images) { Console.WriteLine(string.Format("{0}: {1}x{2}", Enum.GetName(typeof(ICOImageType), img.Type), img.Width, img.Height)); } }
static void ExportFromICO(string ICOPath, string outpath) { DirectoryInfo di = new DirectoryInfo(outpath); if (!di.Exists) { di.Create(); } ICOFile ico = ICOFile.ReadFromFile(ICOPath, false); for (int i = 0; i < ico.Images.Count; i++) { ICOImage img = ico.Images[i]; img.Image.Save(Path.Combine(di.FullName, string.Format("Image{0}.png", i)), ImageFormat.Png); } }