We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Some properties can't be set for an image shape

Hello there. When I try to set to an image shape some properties like line color, line width, opacity they are not set. I’ve seen the topic and noticed that it is a bug. I tried to use the solution that was suggested in the last message, but it doesn’t work too.
Here is the code that I used:
We have an object that has Shape type and its ShapeType property is Image.
image.Fill.Opacity = 0.1;
image.StrokeColor = Color.Blue;
image.StrokeWeight = 5;


Please ZIP and attach your input Word document, Aspose.Words generated output document showing the undesired behavior, the expected document showing the correct output and console application here for testing. You can create expected document by using MS Word. Please also list the steps that you performed in MS Word to create expected document. We will then investigate the scenario on our end and provide you more information.

Here is the example project. All the files in the debug folder.TestProject.zip (4.4 MB)


We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18122. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.


Regarding WORDSNET-18122, problematic shape has DML markup language. Such shapes do not have borders. There is only ability to set outline for problematic shape. The following code allows to set required formatting:

Document doc = new Document("E:\\temp\\TestProject\\input.docx");

Shape shape = (Shape)doc.Sections[0].Body.GetChild(NodeType.Shape, 0, true);
if (shape.MarkupLanguage == ShapeMarkupLanguage.Dml)
    shape.Stroke.On = true;
    shape.Stroke.Color = doc.Theme.Colors.Accent1;
    shape.Stroke.Weight = 5;
    shape.Stroke.Opacity = 0.7;


We have completed the work on your issue and concluded to close this issue as ‘Not a Bug’.