Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Tue Jan 26, 2021 11:36 am

I am trying to get Fill and Line color of shapes in PPTX which includes some shapes which is added on PowerPoint app by hand, but I can't. Those shapes's color in the PPTX file is added without any change of colors that means the shapes has default color.
The result of my program using Spire.Presentation is bellow:

shape.Line.FillType = UnDefined
shape.Line.SolidFillColor.ColorType = KnownColor
shape.Line.SolidFillColor.Color = Color [A=255, R=0, G=0, B=0]
shape.Line.SolidFillColor.SystemColor = None
shape.Line.SolidFillColor.KnownColor = Black
shape.Line.SolidFillColor.SchemeColor = None

The exact shape's Fill and Kine color is (47,82,143), transparency is 0%.
How can I get the exact color?

Regard.

junichi.matsunoshita@fujixerox.co.jp
 
Posts: 12
Joined: Thu Jul 04, 2019 3:54 am

Wed Jan 27, 2021 2:38 am

Hello,

Thanks for your inquiry!

Please refer to the following code to get the fill and line color of shapes.

Code: Select all
            //get Fill and Line color
            foreach (ISlide slide in ppt.Slides)
            {
                foreach (IShape ishape in slide.Shapes)
                {
                    IAutoShape shape = ishape as IAutoShape;
                    Color FillColor = shape.ShapeStyle.FillColor.Color;
                    Color LineColor = shape.ShapeStyle.LineColor.Color;
                }
            }


If you encounter any issues related to our product in the future, just feel free to contact us.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Wed Jan 27, 2021 11:15 am

Thank you for answering.
I tried it and got it what I wanted to get.
Thanks.

junichi.matsunoshita@fujixerox.co.jp
 
Posts: 12
Joined: Thu Jul 04, 2019 3:54 am

Wed Jan 27, 2021 11:33 am

Sorry, I have one more question.
IAutoShape.ShapeStyle doesn't have Line width property. But I don't get Line width from IShape.Line.Width if the shape is added with default line setting.
How I can get Line Width in this case?
Regards.

junichi.matsunoshita@fujixerox.co.jp
 
Posts: 12
Joined: Thu Jul 04, 2019 3:54 am

Thu Jan 28, 2021 8:16 am

Hello,

Thanks for your feedback!

Kindly note that the line width of the Shape created by our product is not assigned by default (i.e. shape.Line.Width = NAn), so you cannot get its line width.

I recommend that you give a value for the line width when you create a new shape with our product (e.g. shape.Line.Width = 5), so that you can get the line width of the shape later.

Hope you can understand.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Jan 28, 2021 11:29 am

I see and I got it.
I hope you will add the feature to your product very near future, and I will appriciete it.
Thanks.

junichi.matsunoshita@fujixerox.co.jp
 
Posts: 12
Joined: Thu Jul 04, 2019 3:54 am

Fri Jan 29, 2021 6:37 am

Hello,

Yes, we will add this feature for you.

Please note that the design of this feature we will implement is that the line width of the shape created by our product still is not assigned by default (i.e. shape.Line.Width = NAn) (this is specified by the PowerPoint document specification itself), just we will make a judgment in internal code, when shape.Line.Width = NAn, we will give it a default value of 2 pt (as shown in MS PowerPoint) so that you can get a value of 2 from shape.Line.Width.

Hope this can match your needs and once the new feature has any progress, we will notify you immediately.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Nov 12, 2021 10:35 am

Hello,

Thanks for your patience!

Glad to inform you that we just released Spire.Presentation Pack Hotfix Version:6.11.2 which fixes the issue of the SPIREPPT-1453.

Please download the fix version from the following links to test.

Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Pr ... ion/6.11.2

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Nov 22, 2021 9:32 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Presentation