Aspose.Slides.Examples.CSharp.Slides.Background.SetBackgroundToGradient.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_Slides_Presentations_Background();

            // Instantiate the Presentation class that represents the presentation file
            using (Presentation pres = new Presentation(dataDir + "SetBackgroundToGradient.pptx"))
            {

                // Apply Gradiant effect to the Background
                pres.Slides[0].Background.Type = BackgroundType.OwnBackground;
                pres.Slides[0].Background.FillFormat.FillType = FillType.Gradient;
                pres.Slides[0].Background.FillFormat.GradientFormat.TileFlip = TileFlip.FlipBoth;

                //Write the presentation to disk
                pres.Save(dataDir + "ContentBG_Grad_out.pptx", SaveFormat.Pptx);
            }
 
        }
    }
SetBackgroundToGradient