using Aspose.Imaging; using System; using System.IO; using System.Text; using System.Collections.Generic; //You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-.NET/blob/master/Examples/Data/Templates.zip //After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder string templatesFolder = @"c:\Users\USER\Downloads\templates\"; // Load the cmx file in an instance of Image using (var image = Aspose.Imaging.Image.Load(Path.Combine(templatesFolder, @"template.cmx"))) { // Create an instance of IcoOptions var exportOptions = new Aspose.Imaging.ImageOptions.IcoOptions(); Aspose.Imaging.ImageOptions.VectorRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.CmxRasterizationOptions(); rasterizationOptions.PageWidth = image.Width; rasterizationOptions.PageHeight = image.Height; exportOptions.VectorRasterizationOptions = rasterizationOptions; // Save cmx to ico image.Save(Path.Combine(templatesFolder, "output.ico"), exportOptions); File.Delete(Path.Combine(templatesFolder, "output.ico")); }