C#: Online Guide
How To: powerpoint SDK
Convert PowerPoint to Png, Gif, Bitmap ... Images
Convert PowerPoint to Png, Gif, Bitmap … images
  |  
Home ›› XDoc.PowerPoint ›› C# PowerPoint: Convert PowerPoint to Png, Gif, Bitmap ... Images

C# PowerPoint - Render PowerPoint to Other Images


Online C# Tutorial for How to Convert PowerPoint to Raster Images, .NET Graphics, and REImage




PowerPoint to Multiple Image Forms Conversion



RasterEdge.com provides C# developers with mature PowerPoint document processing and rendering library SDK. Our XDoc.PowerPoint allows C# developers to perform high performance conversions from PowerPoint document to multiple image forms. Besides raster image Jpeg, images forms like Png, Bmp, Gif, .NET Graphics, and REImage (an intermediate class) are also supported. In the following parts, we provide some examples for these PowerPoint conversions.


Related .net document control helps:
view file asp.net: View multiple document formats in ASP.NET, MVC, Ajax, Azure using C# control
c# asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: view, annotate, redact Adobe PDF files online in ASP.NET
asp.net annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
c# asp.net document redaction: Redact document ASP.NET: add, delete, apply redaction on PDF files in web browser using C#.net
asp.net pdf file permission using c#: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C#
asp.net sharepoint pdf editor using c#: ASP.NET SharePoint PDF Editor Control: view, edit, annotate, redact PDF document in SharePoint sites
c# asp.net tiff document viewer: ASP.NET Tiff Document Viewer: view, annotate Tiff files in HTML using C# Control




C# DLLs: Convert PowerPoint to Images



Add necessary XDoc.PowerPoint DLL libraries into your created C# application as references.


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.Imaging.Basic.Codec.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PowerPoint;




C# Sample Code for PowerPoint to Png



You can use this sample code to convert PowerPoint file to Png image.




// Load a PowerPoint file.
String inputFilePath = Program.RootPath + "\\" + "1.pptx";
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Get the first page of PowerPoint file.
PPTXPage page = (PPTXPage)doc.GetPage(0);

// Convert the first PowerPoint page to a PNG file.
page.ConvertToImage(ImageType.PNG, Program.RootPath + "Output.png");





C# Sample Code for PowerPoint to Bmp



Or use this piece of C# code to implement PowerPoint to Bmp conversion.




// Used to register all DLL assemblies.
WorkRegistry.Reset();

// Load a PowerPoint file.
String inputFilePath = Program.RootPath + "\\" + "1.pptx";
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Get the first page of PowerPoint file.
PPTXPage page = (PPTXPage)doc.GetPage(0);

// Convert the first PowerPoint page to a BMP file.
page.ConvertToImage(ImageType.BMP, Program.RootPath + "\\Output.bmp");





C# Sample Code for PowerPoint to Gif



You can also directly change PowerPoint to Gif image file in C# program.




// Used to register all DLL assemblies.
WorkRegistry.Reset();

// Load a PowerPoint file.
String inputFilePath = Program.RootPath + "\\" + "1.pptx";
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Get the first page of PowerPoint file.
PPTXPage page = (PPTXPage)doc.GetPage(0);

// Convert the first PowerPoint page to a GIF file.
page.ConvertToImage(ImageType.GIF, Program.RootPath + "\\Output.gif");





C# Sample Code for PowerPoint to REImage



Instead, you may render PowerPoint to REImage (an intermediate class) and then do further manipulations. In order to run the demo code, you need use namespace "RasterEdge.Imaging.Raster.Core";




// Used to register all DLL assemblies.
WorkRegistry.Reset();

// Load a PowerPoint file.
String inputFilePath = Program.RootPath + "\\" + "1.pptx";
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Get the first page of PowerPoint.
PPTXPage page = (PPTXPage)doc.GetPage(0);

// Convert the first page to a REImage object.
REImage image = new REImage(page.ConvertToImage());

// Do something ...





C# Sample Code for PowerPoint to .NET Bitmap



Moreover, our SDK also allows you to render PowerPoint to .NET Bitmap in C# programming.




// Used to register all DLL assemblies.
WorkRegistry.Reset();

// Load a PowerPoint file.
String inputFilePath = Program.RootPath + "\\" + "1.pptx";
PPTXDocument doc = new PPTXDocument(inputFilePath);

// Get the first page of PowerPoint.
PPTXPage page = (PPTXPage)doc.GetPage(0);

// Render the page to a Bitmap with default setting.
Bitmap bitmap1 = page.GetBitmap();
bitmap1.Save(inputFilePath + "_1.bmp");
//  ...

// Enlarge the page with factor 2.
float zoomRatio = 2.0F;
Bitmap bitmap2 = page.GetBitmap(zoomRatio);
bitmap2.Save(inputFilePath + "_2.bmp");
//  ...

// Render the page with a resolution of 300 dpi.
int targetResolution = 300;
Bitmap bitmap3 = page.GetBitmap(targetResolution);
bitmap3.Save(inputFilePath + "_3.bmp");
//  ...