Free Support Forum - aspose.com

PPTX picture frame scale width and height issues

Hi all,

I am using Aspose.Slides for .NET for exporting some images to pptx. I have multiple image types, size wise, with width over 900. On my local machine I managed to arrange all the images in the correct places, so it will show good on the slide (code below). Everything is working correctly on the local environment, but when I publish it to the test environment, the posX and posY are the same and ok, but the RelativeScaleHeight and RelativeScaleWidth are not.
It still shows 180% height and 177% width like on my local machine, but on the test environment those values are rendered bigger somehow, and the images are not fitted onto the slide.

Could somebody maybe tell me what could be the problem? I tried adding the images into a Picture placeholder, but the same image is being inserted multiple times in that placeholder, sort of repeating the image.

Every advice will be much appreciated. Thanks in advance!

        if (slideDimensions.WidgetWidth > 900)/
        {
            picFrame = iSlide.Shapes.AddPictureFrame(Aspose.Slides.ShapeType.Rectangle, 0, 0, 0, 0, null);
            picFrame.PictureFormat.Picture.Image = ippImg;
            picFrame.RelativeScaleWidth = 1.77f;

            int imgHeight = picFrame.PictureFormat.Picture.Image.Height;
            int imgWidth = picFrame.PictureFormat.Picture.Image.Width;

            float posX = slideDimensions.SlideWidth * .48f - imgWidth * .6f;
            float posY = slideDimensions.SlideHeight * .7f - imgHeight * .54f;

            if (imgHeight > 200 && imgHeight < 400)
            {
                picFrame.RelativeScaleHeight = 1.8f;
                posY = slideDimensions.SlideHeight * .5f - imgHeight * .6f;
            }
            else if (imgHeight > 400 && imgHeight < 500)
            {
                picFrame.RelativeScaleHeight = 1.3f;
                posY = slideDimensions.SlideHeight * .7f - imgHeight * .67f;
            }
            else
            {
                picFrame.RelativeScaleHeight = 1.05f;
            }

            picFrame.X = posX;
            picFrame.Y = posY;
        }

@robert.titi,

I have observed the information shared by you and it seems that you probably have different display percentage settings on your end. I suggest you to please set 100% as display setting and if there is still an issue then please provide the sample project along with source and generated presentations in both environments. Please also provide the complete environment details as well for reference. Before, sharing the information, I suggest you to please first try using latest Aspose.Slides for .NET 18.10 on your end.