Add Shape
using IronPPT;
using IronPPT.Models;

// Load a PowerPoint presentation
var document = new PresentationDocument("output.pptx");

// Configure new shape
Shape shape = new Shape();
shape.Name = "triangle";
shape.Type = IronPPT.Enums.ShapeType.Triangle;
shape.Resize(100, 100);
shape.FillColor = new Color("#444444");
shape.OutlineColor = Color.Black;
shape.Position = (200, 200);

// Add shape
document.Slides[0].AddShape(shape);

// Export PowerPoint presentation
document.Save("addShape.pptx");
Imports IronPPT
Imports IronPPT.Models

' Load a PowerPoint presentation
Dim document = New PresentationDocument("output.pptx")

' Configure new shape
Dim shape As New Shape()
shape.Name = "triangle"
shape.Type = IronPPT.Enums.ShapeType.Triangle
shape.Resize(100, 100)
shape.FillColor = New Color("#444444")
shape.OutlineColor = Color.Black
shape.Position = (200, 200)

' Add shape
document.Slides(0).AddShape(shape)

' Export PowerPoint presentation
document.Save("addShape.pptx")
NuGet Download
PM > Install-Package IronPPT
Add Shape

Add Shape

Shapes are a fundamental element in PowerPoint, helping to structure content, emphasize key points, and enhance visual appeal. Using shapes effectively allows presenters to organize information, create diagrams, and guide the audience's attention. Whether it's arrows for direction, rectangles for text boxes, or circles for highlighting, shapes make presentations more engaging and professional.

With IronPPT, developers can seamlessly integrate and modify shapes, giving them complete control over PowerPoint slides. This flexibility enables dynamic, polished presentations that effectively communicate ideas and leave a lasting impact.

5-Step Code to Add Shapes

  • Shape shape = new Shape();
  • shape.Type = IronPPT.Enums.ShapeType.Triangle;
  • shape.Resize(100, 100);
  • shape.OutlineColor = Color.Black;
  • shape.Position = (200, 200);

Code Explanation

To add a new shape to our empty PowerPoint presentation, we start by creating a new Shape object using the constructor. Next, we define the type of shape we want to create by modifying the Type property and assigning it one of the values from the ShapeType enum. For example, to create a triangle, we would set the Type to ShapeType.Triangle. After that, we can set the dimensions of the shape by calling the Resize method with the desired width and height in points. To customize the appearance of the shape, we can adjust the OutlineColor property; for this example, we will set the color to black. Finally, we position the shape on the slide by specifying the x and y coordinates, which in this case will be set to (200, 200). This places the shape at the desired location within the presentation.

Learn to Manage Slides with IronPPT
View on GitHub

Ready to Get Started?

Nuget Downloads 6,246Version:2026.10just released