Back to Devexpress

IExportContext.InsertImage(DXImage, XlCellRange) Method

corelibraries-devexpress-dot-printing-dot-exporthelpers-dot-iexportcontext-dot-insertimage-x28-devexpress-dot-drawing-dot-dximage-devexpress-dot-export-dot-xl-dot-xlcellrange-x29.md

latest3.0 KB
Original Source

IExportContext.InsertImage(DXImage, XlCellRange) Method

Inserts an image into the specified cell range.

Namespace : DevExpress.Printing.ExportHelpers

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
void InsertImage(
    DXImage image,
    XlCellRange range
)
vb
Sub InsertImage(
    image As DXImage,
    range As XlCellRange
)

Parameters

NameTypeDescription
imageDXImage

The image to insert.

| | range | XlCellRange |

A cell range.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the InsertImage(DXImage, XlCellRange) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-customize-data-aware-export-output/CS/GridDataAwareExportCustomization/Form1.cs#L123

csharp
e.ExportContext.MergeCells(imageToHeaderRange);
e.ExportContext.InsertImage(imageToHeader, imageToHeaderRange);
e.ExportContext.MergeCells(new XlCellRange(new XlCellPosition(0, 8), new XlCellPosition(5, 8)));

winforms-grid-customize-data-aware-export-output/VB/GridDataAwareExportCustomization/Form1.vb#L127

vb
e.ExportContext.MergeCells(imageToHeaderRange)
e.ExportContext.InsertImage(imageToHeader, imageToHeaderRange)
e.ExportContext.MergeCells(New XlCellRange(New XlCellPosition(0, 8), New XlCellPosition(5, 8)))

See Also

IExportContext Interface

IExportContext Members

DevExpress.Printing.ExportHelpers Namespace