Aspose.Slides.Examples.CSharp.Shapes.CreateGroupShape.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 Prseetation class 
            using (Presentation pres = new Presentation())
            {
                // Get the first slide 
                ISlide sld = pres.Slides[0];

                // Accessing the shape collection of slides 
                IShapeCollection slideShapes = sld.Shapes;

                // Adding a group shape to the slide 
                IGroupShape groupShape = slideShapes.AddGroupShape();

                // Adding shapes inside added group shape 
                groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 300, 100, 100, 100);
                groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 500, 100, 100, 100);
                groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 300, 300, 100, 100);
                groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 500, 300, 100, 100);

                // Adding group shape frame 
                groupShape.Frame = new ShapeFrame(100, 300, 500, 40, NullableBool.False, NullableBool.False, 0);

                // Write the PPTX file to disk 
                pres.Save(dataDir + "GroupShape_out.pptx", SaveFormat.Pptx);
            }
        }
    }
CreateGroupShape