Aspose.Slides.Examples.CSharp.Shapes.FillShapeswithSolidColor.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();

            // Create an instance of Presentation class
            Presentation presentation = new Presentation();

            // Get the first slide
            ISlide slide = presentation.Slides[0];

            // Add autoshape of rectangle type
            IShape shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 150, 75, 150);

            // Set the fill type to Solid
            shape.FillFormat.FillType = FillType.Solid;

            // Set the color of the rectangle
            shape.FillFormat.SolidFillColor.Color = Color.Yellow;

            //Write the PPTX file to disk
            presentation.Save(dataDir + "RectShpSolid_out.pptx", SaveFormat.Pptx);
        }
    }
FillShapeswithSolidColor