Aspose.Slides.Examples.CSharp.Shapes.AddRelativeScaleHeightPictureFrame.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Shapes();

            // Instantiate presentation object
            using (Presentation presentation = new Presentation())
            {

                // Load Image to be added in presentaiton image collection
                Image img = new Bitmap(dataDir + "aspose-logo.jpg");
                IPPImage image = presentation.Images.AddImage(img);

                // Add picture frame to slide
                IPictureFrame pf = presentation.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 50, 50, 100, 100, image);

                // Setting relative scale width and height
                pf.RelativeScaleHeight = 0.8f;
                pf.RelativeScaleWidth = 1.35f;

                // Save presentation
                presentation.Save(dataDir + "Adding Picture Frame with Relative Scale_out.pptx", SaveFormat.Pptx);
            }
           

        }
    }
AddRelativeScaleHeightPictureFrame