Message-ID: <313650810.9845.1711704966801.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9844_1217696960.1711704966785" ------=_Part_9844_1217696960.1711704966785 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Chart.SaveImage(string, ImageFormat, int?, int?)

Chart.SaveImage(string, ImageFormat, int?, int?)

Introduced in build 9.1

Descri= ption

Saves a=20 Chart as a specified image format at a s= pecified file path with the specified dimensions in pixels.=20
C#
=20
 public static void SaveImage(String filePath, =
ImageFormat imageFormat, int? width, int? height)
=20
=20
vb.net
=20
Public Static Sub SaveImage(ByVal filePath As St=
ring, ByVal imageFormat As ImageFormat, ByVal width As int?, ByVal height A=
s int?)
=20

Paramet= ers

=20
filePath<= /h6> A=20 string representing the filepath you would like to save t= he image to.=20
ImageF= ormat
The file format ExcelWriter will save the chart as. Supported fi= le types include GIF, JPEG, BMP, PNG, EMF, TIFF, and WMF=20
width
T= he width of the image in pixels=20
height
= The height of the image in pixels.

 

Excepti= ons

=20
S= ystem.Exception
If there is a problem creating, opening, or writing to= the file specified, or reading from the Chart object.=20

Examples<= /h2>=20
C#
=20
           ExcelApplication xla =3D new ExcelApplication();
           Workbook WB=3D xla.Create(FileFormat.Xlsx);
           Chart chartOne=3D WB[0].Charts[0];         =20
           chartOne.SaveImage("Path/filename.png", System.Drawing=
.Imaging.ImageFormat.Png, 240, 180);            
=20
vb.net
=20
=09   Dim oExcelApp As New ExcelApplication()          =20
           Dim wb As Workbook =3D oExcelApp.Create(FileFormat.Xlsx)=20
           Dim chartOne As Chart =3D WB[0].Charts[0]         =20
           chartOne.SaveImage("Path/filename.png", System.Drawing=
.Imaging.ImageFormat.Png, 240, 180)                 
=20

------=_Part_9844_1217696960.1711704966785--