Back to Devexpress

ChartControlBase.ExportToImage(String, ImageExportOptions) Method

wpf-devexpress-dot-xpf-dot-charts-dot-chartcontrolbase-dot-exporttoimage-x28-system-dot-string-devexpress-dot-xtraprinting-dot-imageexportoptions-x29.md

latest3.9 KB
Original Source

ChartControlBase.ExportToImage(String, ImageExportOptions) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Exports a chart to the specified file using the specified options in the image format.

Namespace : DevExpress.Xpf.Charts

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public void ExportToImage(
    string filePath,
    ImageExportOptions options
)
vb
Public Sub ExportToImage(
    filePath As String,
    options As ImageExportOptions
)

Parameters

NameTypeDescription
filePathString

The value defining the full path (including the file name and extension) where the image file will be created.

| | options | ImageExportOptions |

An object storing the image export options to be applied when a chart is exported.

|

Remarks

To print the document immediately without invoking any dialogs, use the ChartControlBase.PrintDirect method.

To show the standard Print dialog, use the ChartControlBase.Print method. The dialog allows end-users to print the chart, select the printer (if required), specify the range of pages to print, the number of copies, etc.

To display the DevExpress Document Preview, use one of the following methods.

MethodDescription
ChartControlBase.ShowPrintPreviewCreates the print document and displays the Print Preview of the document.
ChartControlBase.ShowPrintPreviewDialogCreates the print document and displays the Print Preview of the document as a modal window.
ChartControlBase.ShowRibbonPrintPreviewCreates the print document and displays the Print Preview with the Ribbon toolbar of the document.
ChartControlBase.ShowRibbonPrintPreviewDialogCreates the print document and displays the Print Preview with the Ribbon toolbar of the document as a modal window.

To export the chart, use the appropriate ExportTo~ method (e.g., ChartControlBase.ExportToHtml, ChartControlBase.ExportToPdf, etc.)

Important

The chart can be previewed, printed and exported only if the DXPrinting Library is available. Make sure you add a reference to the DevExpress.Xpf.Printing.v25.2 assembly.

Also note that chart export to PDF is available if the DevExpress.Pdf.Core library is available.

See Also

ChartControlBase Class

ChartControlBase Members

DevExpress.Xpf.Charts Namespace