Free Support Forum -

Problem updating colors of shapes in existing diagram

I am having trouble changing the colors (background/foreground) of existing shapes in a Visio.

Here is the code I was trying any help would be greatly appreciated.

Diagram diagram1 = new Diagram(“test.vsd”);

foreach (Shape s in diagram1.Pages[0].Shapes)


s.Line.LineColor.Value = “#ff0000”;

s.Line.LineWeight.Value = 0.03;

s.Fill.FillBkgnd.Value = “#ff00ff”;

s.Fill.FillForegnd.Value = “#0000ff”;

s.Fill.FillPattern.Value = 31;


diagram1.Save(“test.jpg”, SaveFileFormat.JPEG);

Hi Jeff,

Thanks for your inquiry. I tested your sample document against the latest build of Aspose.Diagram 3.3.0 and managed to replicate the problem. I have logged an issue under ticket id DIAGRAM-33421 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is resolved and available for the public use. We’re sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAM-33421) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Jeff,

Please try using the following source code:

Diagram diagram = new Diagram(“test.vsd”);<o:p></o:p>

foreach (Shape shape in diagram.Pages[0].Shapes)


shape.Line.LineColor.Value = "#ff0000";

shape.Line.LineWeight.Value = 0.03;

shape.Fill.FillBkgnd.Value = "#ff00ff";

shape.Fill.FillForegnd.Value = "#0000ff";

shape.Fill.FillPattern.Value = 31;

if (shape.Type == TypeValue.Group)


foreach (Shape sp in shape.Shapes)


sp.Line.LineColor.Value = "#ff0000";

sp.Line.LineWeight.Value = 0.03;

sp.Fill.FillBkgnd.Value = "#ff00ff";

sp.Fill.FillForegnd.Value = "#0000ff";

sp.Fill.FillPattern.Value = 31;





Please do let me know in case of any confusion or questions.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.