In certain cases, you may need to convert the slides in PowerPoint presentations to images. For example, to embed presentations in your web or desktop applications, to generate thumbnails, etc. PNG is one of the most popular image formats which uses lossless compression. Therefore, in this article, you will learn how to convert slides in PowerPoint PPT to PNG in C#.
- .NET API for PowerPoint to PNG Conversion
- How to Convert PPT to PNG in C#
- Convert PowerPoint PPTX or PPT to PNG
PowerPoint PPT to PNG C# Converter - Free Download
To convert the PPTX or PPT to PNG, we will use Aspose.Slides for .NET. It is a feature-rich API that lets you create, modify and convert PowerPoint and OpenOffice presentations using C#. You can either download the API or install it using NuGet.
PM> Install-Package Aspose.Slides.NET
How to Convert PPT to PNG in C#
Aspose.Slides for .NET provides the easiest way of converting PPT slides to PNG. The following are the steps to perform this conversion.
- Load the PPT presentation.
- Loop through the slides in PPT.
- Save each PPT slide as PNG.
Let’s now write the code and convert a PowerPoint PPT to PNG images in C#.
Convert PPT to PNG in C#
The following are the steps to convert slides in a PowerPoint PPT to PNG using C#.
- First, create an instance of the Presentation class to load the presentation.
- Loop through each ISlide in Presentation.Slides collection.
- Define the dimensions of the resultant PNG image.
- Generate an image of each slide using ISlide.GetThumbnail(float ScaleX, float ScaleY) method and get the reference of an image into a Bitmap object.
- Finally, save the image as PNG using Bitmap.Save(String, System.Drawing.Imaging.ImageFormat.Png) method.
The following code sample shows how to convert a PPT to PNG in C#.
C# PPT to PNG Converter - Get a Free License
You can convert PowerPoint PPT to PNG without evaluation limitations by getting a free temporary license.
Try the online PowerPoint to PNG converter, which is based on Aspose.Slides.
In this article, you have learned how to convert slides in PowerPoint PPTX or PPT to PNG using C#. You can simply install the API and use the provided code in your .NET applications.