Hello,
Thanks for the big support that you provide us through all the products.
I’m working now with Aspose diagram and I need to color the line of some shapes.
the code below works fine with most of the cases. but when the shape lineStyle is set to “No Line” the code doesn’t work.
in the attached file a simple example of shape where I can’t get to the line color.
License license = new License();
[//license.setLicense](https://license.setlicense/)(“C://Users//ark//Desktop//Visio Import//Aspose.Total.Java.lic.resj”);
license.setLicense(Licenses.class.getResourceAsStream("/Aspose.Total.Java.lic.resj"));
// The path to the documents directory.
String dataDir = “C://Users//ark//Desktop//Visio Import//Diagrams//”;
// Call the diagram constructor to load diagram
Diagram vdxDiagram = new Diagram(dataDir + “testCHD.vsd”);
for (Shape shape : (Iterable) vdxDiagram.getPages().get(0).getShapes()) {
if ((shape.getType() == TypeValue.GROUP) && (shape.getShapes().getCount() > 0)) {
for (Shape subShape : (Iterable) shape.getShapes()) {
if (shape.getType() != TypeValue.UNDEFINED) {
System.out.println(“ID :” + subShape.getID() + " " + TestGroup.getName(subShape));
System.out.println(“Master :” + subShape.getMaster().getName());
subShape.getLine().getLineColor().setValue(“FF0000”);
subShape.getLine().getLineWeight().setValue(0.03);
}
}
} else {
System.out.println(“ID :” + shape.getID() + " " + RandomTest.getName(shape));
}
}
ImageSaveOptions imgOpts = null;
imgOpts = new ImageSaveOptions(SaveFileFormat.PNG);
imgOpts.setPageIndex(0);
Page page = vdxDiagram.getPages().get(0);
//String urlRead = AnalysisRenderingToolbox.getGenerationFolderRead(root.currentEnvironment().getContext(), root, imgurl);
vdxDiagram.save(dataDir + “groupColor.png”, imgOpts);