Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fileformat-slides-gists/98e41746790148ae2502aecbd8500d2f to your computer and use it in GitHub Desktop.
Save fileformat-slides-gists/98e41746790148ae2502aecbd8500d2f to your computer and use it in GitHub Desktop.
How to Draw Rectangle in PowerPoint PPT PPTX Slides | FileFormat.Slides
Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\draw.pptx");
// Create slide
Slide slide = new Slide();
// Create Rectangle object and set it's properties
Rectangle rectangle = new Rectangle();
rectangle.Width = 500.0;
rectangle.Height =300.0;
rectangle.X = rectangle.Width / 2;
rectangle.Y = rectangle.Height / 2;
rectangle.BackgroundColor = "5f7200";
slide.DrawRectangle(triangle);
// Append slide into presentation
presentation.AppendSlide(slide);
// Save presentation
presentation.Save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment