Exporting shape as PNG or SVG

Is there a way to extract a shape from a VSS and save it as either png or svg using this library?

Hi Keith,

Thank you for contacting support. Yes, it is supported. Please use the code snippet below:

// Load stencil file to a diagram
object Diagram stencil = new Diagram("c:/temp/MyStencil.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("C:/temp/MyImage.png", System.Drawing.Imaging.ImageFormat.Png);

}

We hope, this helps. Please reply us in case of any confusion or questions.

In Java?


EDIT:

never mind, I got it:

byte[] bytes = master.getIcon();

Thanks for the help
Hi Keith,

Thank you for updating us. It is nice to hear from you that the problem has been solved. Please feel free to reply us if you have any question regarding Aspose APIs, we will be happy to help you.