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 May 09, 2017 9:02 pm

Hi there,

I'm currently working on trying to resize shapes and it seems that some shapes are not resizing even when I explicitly set the value of the width/height. For ITables, the resizing does not work at all as I have to resize every single TableColumn (TableRow's height is not settable).

For example, I'm trying to resize all shapes to its new size but the height and width values stay the same (for some shapes)

Code: Select all
foreach (IMasterSlide masterSlide in slideToAdjust.Presentation.Masters) {
                foreach (IShape shape in masterSlide.Shapes) {
                    shape.Height = shape.Height * ratioHeight;
                    shape.Width = shape.Width * ratioWidth;

                    shape.Left = shape.Left * ratioWidth;
                    shape.Top = shape.Top * ratioHeight;

                    if (shape is Line) {
                        var autoShape = (IAutoShape)shape;

                        autoShape.Height *= ratioHeight;
                        autoShape.Width *= ratioWidth;
                    }
                }
            }


If I'm doing something wrong please let me know, thanks in advance!

jinhuang1992
 
Posts: 13
Joined: Wed Mar 08, 2017 2:21 pm

Wed May 10, 2017 3:02 am

Dear jinhuang1992,

Thanks for your inquiry.
I guess this post is related to the post, and we are doing a new feature which would automatically adjust the size of all shapes on the slide, then you needn't to resize it. Once it is done, your issue will be solved.
In addition, could you please share your sample file showing the shapes so that we can have a better investigation ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Presentation