Add Image

When it comes to PowerPoint presentations, incorporating visuals to illustrate your point with text is a key pillar of expressing your ideas and creating informative content. Adding visuals, such as images, allows users to illustrate points more effectively. Furthermore, the ability to modify and set specific locations on the slide, angles of the image, and dimensions further helps customize the PowerPoint.

With IronPPT, we can do it all within one place, allowing developers to fully customize how they want to place their images on their PowerPoint presentation.

5-Step Code to Add Images

  • Image image = new Image();
  • image.LoadFromFile("sample.png");
  • var newImage = document.AddImage(image, 0);
  • newImage.Position = (200, 200);
  • newImage.Angle = 45;

Code Explanation

To load the desired image, we first instantiate a new Image class, then use LoadFromFile to load the desired image. Afterwards, we add the image to the PowerPoint presentation using AddImage, providing the loaded image as a parameter, as well as the slide index. In this example, we are adding the sample.png onto the first slide of the PowerPoint presentation.

After adding the image, we can specify its location on the slide by assigning the x and y coordinates of the image relative to the slide. In the example, we set Position to the x and y coordinates of 200.

To further customize and change the angle of the image, we use the Angle property and set the value to 45.

Discover how to manage slides seamlessly with IronPPT for a more dynamic presentation experience!

Talk to an Expert Five Star Trust Score Rating

Ready to Get Started?

Nuget Passed