Skip to content

Instantly share code, notes, and snippets.

@documentprocessing
Created December 7, 2024 06:42
Show Gist options
  • Save documentprocessing/023f249460f46acf453c117c7e519a38 to your computer and use it in GitHub Desktop.
Save documentprocessing/023f249460f46acf453c117c7e519a38 to your computer and use it in GitHub Desktop.
Add Image in a Slide in .NET
Presentation presentation = Presentation.Create("InsertImageInSlide.pptx");
// Create slide
Slide slide = new Slide();
// Add text shapes.
Image image1 = new Image("image.png");
// Set xAxis
image1.X = 180.0;
// Set yAxis
image1.Y = 128.0;
// Set Width
image1.Width = 195.0;
// Set Height
image1.Height = 55.0;
// Add image to slide
slide.AddImage(image1);
// Adding slides
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