How do you get a Shape (Aspose) object from the ByteArray



Thanks,
Roshan

Hi Roshan,

Thanks for your inquiry. Could you please share some more detail about your query? We will then provide you more information on this along with code.

Hi,

I have reframed the question and posted in the Imaging forum

Limited PNG options in Aspose.Imaging vs Aspose.Words in EMF conversion - Free Support Forum - aspose.com

In Aspose Words, I can do the following

NodeList shapes = converter.getAsposeDoc().selectNodes(“//DrawingML”);
for (shape : shapes) {

pngSaveOptions= new ImageSaveOptions(SaveFormat.PNG);
pngSaveOptions.setResolution(600);
pngSaveOptions.setUseHighQualityRendering(true);
pngSaveOptions.setDmlRenderingMode(DmlRenderingMode.DRAWING_ML);
pngSaveOptions.setDmlEffectsRenderingMode(DmlEffectsRenderingMode.FINE);
pngSaveOptions.setUseAntiAliasing(true);

shape.getShapeRenderer().save(converter.getImageDirectory().getAbsolutePath() + File.separator + imageName+AsposeImageType.PNG.getExtension(),pngSaveOptions);

}

I get high quality PNG images saved converted from EMF

But, If I already have an EMF saved on the disk (or in a Byte Array), and use the prototypical way of converting it to PNG
try
{
String filePath = myDir + “image2.emf”;
// Load a Metafile in an instance of EmfMetafileImage class
EmfMetafileImage metafile =
new EmfMetafileImage(filePath);
// Save image to Png using PngOptions object
metafile.save(myDir + “output.png”,
new PngOptions());
}
catch(Exception ex)
{
System.
out.println(ex.toString());
}

I get a crappy quality PNG file out of it. Why doesn’t Imaging have the same options as Words?

What is the best way to match the quality of of Aspose Words conversion process from a Shape object when the Image is already stored in a File or a Byte Array?.


Thanks,
Roshan

Hi Roshan,

Thanks for sharing the detail. Your query is related to Aspose.Imaging and my colleague answered your query here. Please follow that thread for further proceedings.

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.