IRONSOFTWAREHOME
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,070Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required