API Reference
ExcelImage
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.
Returned or exposed by
- Method ExcelImage.Decorative
- Method ExcelImage.LockAspectRatio
- Method ExcelImage.MoveTo
- Method ExcelImage.SetAltText
- Method ExcelImage.SetCropRatio
- Method ExcelImage.SetFlip
- Method ExcelImage.SetRotation
- Method ExcelImage.SetSize
- Method ExcelImage.SetSizePercent
- Method ExcelImage.SetTwoCellEndingMarker
- Method ExcelSheet.AddImage
- Method ExcelSheet.AddImageAbsolute
- Method ExcelSheet.AddImageFromFile
- Method ExcelSheet.AddImageFromFileToRange
- Method ExcelSheet.AddImageFromUrlAsync
- Method ExcelSheet.AddImageFromUrlAsync
- Method ExcelSheet.AddImageFromUrlAsync
- Method ExcelSheet.AddImageFromUrlAtAsync
- Method ExcelSheet.AddImageFromUrlToRangeAsync
- Method ExcelSheet.AddImageToRange
- Method ExcelSheet.GetImage
- Property ExcelSheet.Images
Methods
public ExcelImage Decorative() #ExcelImageClears image alt text metadata for decorative images.
public ExcelImage LockAspectRatio(Boolean locked = true) #ExcelImageControls whether Excel should keep the picture aspect ratio locked.
Parameters
- locked System.Boolean = true
public ExcelImage MoveTo(Int32 row, Int32 column, Int32 offsetXPixels = 0, Int32 offsetYPixels = 0) #ExcelImageMoves the image to a one-cell anchor position and optionally applies pixel offsets.
Parameters
- row System.Int32
- 1-based target row.
- column System.Int32
- 1-based target column.
- offsetXPixels System.Int32 = 0
- Horizontal offset from the cell edge, in pixels.
- offsetYPixels System.Int32 = 0
- Vertical offset from the cell edge, in pixels.
public ExcelImage SetAltText(String description, String title = null) #ExcelImageSets image title and description metadata.
Parameters
- description System.String
- title System.String = null
public ExcelImage SetCropRatio(Double left, Double top, Double right, Double bottom) #ExcelImageSets image crop ratios, where 0 means no crop and 1 means the full source dimension.
Parameters
- left System.Double
- top System.Double
- right System.Double
- bottom System.Double
public ExcelImage SetFlip(Boolean horizontal, Boolean vertical) #ExcelImageSets image flip transforms.
Parameters
- horizontal System.Boolean
- vertical System.Boolean
public ExcelImage SetRotation(Double degrees) #ExcelImageSets clockwise image rotation in degrees.
Parameters
- degrees System.Double
- Clockwise rotation in degrees. Fractional values are supported by DrawingML.
public ExcelImage SetSize(Int32 widthPixels, Int32 heightPixels) #ExcelImageSets the image size in pixels.
Parameters
- widthPixels System.Int32
- heightPixels System.Int32
public ExcelImage SetSizePercent(Double percent) #ExcelImageScales the image from its current size by the specified percentage.
Parameters
- percent System.Double
- Percentage of the current image size. For example, 20 means 20%.
public ExcelImage SetTwoCellEndingMarker(Int32 toRow, Int32 toColumn, Int32 toOffsetXPixels = 0, Int32 toOffsetYPixels = 0) #ExcelImageSets the ending marker for a two-cell anchored image using 1-based worksheet marker coordinates.
Parameters
- toRow System.Int32
- 1-based ending row marker.
- toColumn System.Int32
- 1-based ending column marker.
- toOffsetXPixels System.Int32 = 0
- Horizontal offset from the ending marker column.
- toOffsetYPixels System.Int32 = 0
- Vertical offset from the ending marker row.
public Byte[] ToBytes() #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) #BooleanTries to read the image bounds when it is positioned by an absolute worksheet drawing anchor.
Parameters
- xPixels System.Int32@
- yPixels System.Int32@
- widthPixels System.Int32@
- heightPixels System.Int32@
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
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.