API Reference

Class

ExcelImage

Namespace OfficeIMO.Excel
Assembly OfficeIMO.Excel
Modifiers sealed

Represents a worksheet image anchored in the drawing layer.

Inheritance

  • Object
  • ExcelImage

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public ExcelImage Decorative() #
Returns: ExcelImage

Clears image alt text metadata for decorative images.

public ExcelImage LockAspectRatio(Boolean locked = true) #
Returns: ExcelImage

Controls whether Excel should keep the picture aspect ratio locked.

Parameters

locked System.Boolean = true optionalposition: 0
public ExcelImage MoveTo(Int32 row, Int32 column, Int32 offsetXPixels = 0, Int32 offsetYPixels = 0) #
Returns: ExcelImage

Moves the image to a one-cell anchor position and optionally applies pixel offsets.

Parameters

row System.Int32 requiredposition: 0
1-based target row.
column System.Int32 requiredposition: 1
1-based target column.
offsetXPixels System.Int32 = 0 optionalposition: 2
Horizontal offset from the cell edge, in pixels.
offsetYPixels System.Int32 = 0 optionalposition: 3
Vertical offset from the cell edge, in pixels.
public ExcelImage SetAltText(String description, String title = null) #
Returns: ExcelImage

Sets image title and description metadata.

Parameters

description System.String requiredposition: 0
title System.String = null optionalposition: 1
public ExcelImage SetCropRatio(Double left, Double top, Double right, Double bottom) #
Returns: ExcelImage

Sets image crop ratios, where 0 means no crop and 1 means the full source dimension.

Parameters

left System.Double requiredposition: 0
top System.Double requiredposition: 1
right System.Double requiredposition: 2
bottom System.Double requiredposition: 3
public ExcelImage SetFlip(Boolean horizontal, Boolean vertical) #
Returns: ExcelImage

Sets image flip transforms.

Parameters

horizontal System.Boolean requiredposition: 0
vertical System.Boolean requiredposition: 1
public ExcelImage SetRotation(Double degrees) #
Returns: ExcelImage

Sets clockwise image rotation in degrees.

Parameters

degrees System.Double requiredposition: 0
Clockwise rotation in degrees. Fractional values are supported by DrawingML.
public ExcelImage SetSize(Int32 widthPixels, Int32 heightPixels) #
Returns: ExcelImage

Sets the image size in pixels.

Parameters

widthPixels System.Int32 requiredposition: 0
heightPixels System.Int32 requiredposition: 1
public ExcelImage SetSizePercent(Double percent) #
Returns: ExcelImage

Scales the image from its current size by the specified percentage.

Parameters

percent System.Double requiredposition: 0
Percentage of the current image size. For example, 20 means 20%.
public ExcelImage SetTwoCellEndingMarker(Int32 toRow, Int32 toColumn, Int32 toOffsetXPixels = 0, Int32 toOffsetYPixels = 0) #
Returns: ExcelImage

Sets the ending marker for a two-cell anchored image using 1-based worksheet marker coordinates.

Parameters

toRow System.Int32 requiredposition: 0
1-based ending row marker.
toColumn System.Int32 requiredposition: 1
1-based ending column marker.
toOffsetXPixels System.Int32 = 0 optionalposition: 2
Horizontal offset from the ending marker column.
toOffsetYPixels System.Int32 = 0 optionalposition: 3
Vertical offset from the ending marker row.
public Byte[] ToBytes() #
Returns: Byte[]

Returns a copy of the image bytes from the worksheet drawing relationship.

public Boolean TryGetAbsoluteAnchorBounds(out Int32 xPixels, out Int32 yPixels, out Int32 widthPixels, out Int32 heightPixels) #
Returns: Boolean

Tries to read the image bounds when it is positioned by an absolute worksheet drawing anchor.

Parameters

xPixels System.Int32@ requiredposition: 0
yPixels System.Int32@ requiredposition: 1
widthPixels System.Int32@ requiredposition: 2
heightPixels System.Int32@ requiredposition: 3

Properties

public String Name { get; set; } #

Gets or sets the image drawing name.

public String Title { get; set; } #

Gets or sets the image title metadata.

public String Description { get; set; } #

Gets or sets the image alternative text description.

public Boolean IsAspectRatioLocked { get; } #

Gets whether Excel should keep the picture aspect ratio locked.

public Int32 RowIndex { get; } #

Gets the 1-based row index where the image is anchored, when available.

public Int32 ColumnIndex { get; } #

Gets the 1-based column index where the image is anchored, when available.

public Int32 WidthPixels { get; } #

Gets the image width in pixels from the drawing extent.

public Int32 HeightPixels { get; } #

Gets the image height in pixels from the drawing extent.

public Int32 OffsetXPixels { get; } #

Gets the image horizontal offset from the anchor cell origin in pixels.

public Int32 OffsetYPixels { get; } #

Gets the image vertical offset from the anchor cell origin in pixels.

public Boolean HasTwoCellAnchor { get; } #

Gets whether the image is positioned with a two-cell drawing anchor.

public Boolean HasAbsoluteAnchor { get; } #

Gets whether the image is positioned with an absolute drawing anchor.

public Nullable<Int32> ToRowIndex { get; } #

Gets the 1-based ending row index for two-cell anchored images, when available.

public Nullable<Int32> ToColumnIndex { get; } #

Gets the 1-based ending column index for two-cell anchored images, when available.

public Int32 ToOffsetXPixels { get; } #

Gets the horizontal offset from the two-cell ending marker column in pixels.

public Int32 ToOffsetYPixels { get; } #

Gets the vertical offset from the two-cell ending marker row in pixels.

public Double CropLeftRatio { get; } #

Gets the left crop ratio authored on the image, where 0 means no crop and 1 means the full width.

public Double CropTopRatio { get; } #

Gets the top crop ratio authored on the image, where 0 means no crop and 1 means the full height.

public Double CropRightRatio { get; } #

Gets the right crop ratio authored on the image, where 0 means no crop and 1 means the full width.

public Double CropBottomRatio { get; } #

Gets the bottom crop ratio authored on the image, where 0 means no crop and 1 means the full height.

public Double RotationDegrees { get; set; } #

Gets or sets clockwise image rotation in degrees.

public Boolean FlipHorizontal { get; } #

Gets whether the image has an authored horizontal flip transform.

public Boolean FlipVertical { get; } #

Gets whether the image has an authored vertical flip transform.

public Int32 DrawingOrder { get; } #

Gets this image anchor's zero-based order in the worksheet drawing layer.

public String ContentType { get; } #

Gets the image content type, such as image/png or image/jpeg.