// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Shapes(); // Load stencil file to a diagram object Diagram stencil = new Diagram(dataDir + "Timeline.vss"); // Get master Master master = stencil.Masters.GetMaster(1); using (System.IO.MemoryStream stream = new System.IO.MemoryStream(master.Icon)) { // Load memory stream into bitmap object System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(stream); // Save as png format bitmap.Save(dataDir + "MasterIcon_out.png", System.Drawing.Imaging.ImageFormat.Png); }