How to get '.vsdx' shape color


i use aspose.diagram for java,have a problem,i want get shape color,but the ‘.vsdx’ file get color empty.
my code is:
String lineColor = shape.getLine().getLineColor().getValue();String fillColor = shape.getFill().getFillForegnd().getValue()
both of this is empty



Could you please share your sample Diagram file with us. We will test the scenario in our environment and address it accordingly.


image.png (9.9 KB)
i can’t upload ‘vsdx’,please look the png. i want get the shape color and the line width,i don’t know use api is correct,if possinle, you can give me the correct api or demo.



You may add your .vsdx to ZIP Archive and share with us by attaching it with your post.

#5 (28.1 KB)



We tried to extract the file from archive you shared, but it looked like the archive was corrupt. However, would you please try using following code snippet in order to get shape color:

Aspose.Diagram.Diagram diagram = new Diagram.Diagram(dataDir + "Shape_With_Date.vsdx");
foreach(Aspose.Diagram.Shape shape in diagram.Pages[0].Shapes)
  var fill = shape.InheritFill.FillBkgnd.Value;

You can further explore different properties of shape.InheritFill in above code snippet to extract values. In case you still face any issue, please feel free to let us know. You can also upload your sample file to Dropbox or Google Drive and share the link with us.


thanks,i try it.