Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Introducedin
09.1

Description

Excerpt

Saves a Chart in as a specified image format at a specified file path with the specified dimensions in pixels.

Signature
C#
C#
 public static void SaveImage(String filePath, ImageFormat imageFormat, int? width, int? height)
Signature
vb.net
vb.net
Public Static Sub SaveImage(ByVal filePath As String, ByVal imageFormat stream As ImageFormat, ByVal width As int?, ByVal height As int?)

...

Example
Code Block
csharp
csharp
titleC#
           ExcelApplication xla = new ExcelApplication();
           Workbook WB= xla.Create(FileFormat.Xlsx);
           Chart chartOne= WB[0].Charts[0];          
           chartOne.SaveImage("Path/filename.png"), System.Drawing.Imaging.ImageFormat.Png, 240, 180);            
Code Block
vb.net
vb.net
titlevb.net
	   Dim oExcelApp As New ExcelApplication()           
           Dim wb As Workbook = oExcelApp.Create(FileFormat.Xlsx) 
           Dim chartOne As Chart = WB[0].Charts[0]          
           chartOne.SaveImage("Path/filename.png"), System.Drawing.Imaging.ImageFormat.Png, 240, 180)