Table of Contents

Class XlsxImage

Namespace
DocWright.Formats.Xlsx
Assembly
DocWright.Formats.Xlsx.dll

An image anchored on a worksheet.

public sealed class XlsxImage
Inheritance
XlsxImage
Inherited Members

Remarks

The anchor is a cell plus an offset into it, and the size is explicit. That is SpreadsheetML's one-cell anchor: the image keeps its size when rows and columns are resized and only its top-left corner follows the cell. The two-cell anchor, which stretches an image between two corners, is not modelled — an image that changes shape when a user widens a column is not what a report meant, and the reference implementation's own output pins both corners to reproduce a fixed size, which is the same intent expressed with more parts.

The bytes are held as given and written into the package unchanged. Nothing here decodes, re-encodes or rescales them, so the content type has to be right: Excel reads the part's declared type, not the bytes.

Constructors

XlsxImage(byte[], string, int, int, Emu, Emu)

Creates an anchored image.

Properties

Column

Gets the one-based column the top-left corner sits in.

ContentType

Gets the media type.

Data

Gets the encoded image bytes, written into the package unchanged.

Description

Gets or sets the alternative text, or null for none.

Height

Gets the drawn height.

Name

Gets or sets the name the drawing carries, or null for a generated one.

OffsetX

Gets or sets the offset right of the anchor cell's left edge.

OffsetY

Gets or sets the offset below the anchor cell's top edge.

Row

Gets the one-based row the top-left corner sits in.

Width

Gets the drawn width.