Skip to main content
All docs
V25.1
  • Row

    Cell.ImageInfo Property

    Obtains information about an image embedded in the cell.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    ImageInfo ImageInfo { get; }

    Property Value

    Type Description
    ImageInfo

    An object that contains cell image information.

    Example

    The following code snippet places an image from a stream in a cell and specifies its alternative text:

    using (Workbook workbook = new Workbook()) {
        Worksheet worksheet = workbook.Worksheets.ActiveWorksheet;
    
        byte[] imageBytes = File.ReadAllBytes("image.png");
    
        // Insert cell images from a stream
        worksheet.Cells["A2"].Value = imageStream;
    
        // Specify image information
        if (worksheet.Cells["A2"].Value.IsCellImage) {
            worksheet.Cells["A2"].ImageInfo.Decorative = true;
            worksheet.Cells["A2"].ImageInfo.AlternativeText = "Image AltText";
        }
    
        workbook.SaveDocument("result.xlsx");
    }
    
    See Also