Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelTemplateImage

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Source revision
273d35d5ba8a with working tree changes
Modifiers
sealed

Image value that can be bound to a whole-cell template marker.

Inheritance

  • object
  • ExcelTemplateImage

Usage

Explore 3 API references to this type

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

Methods

public static ExcelTemplateImage FromBytes(byte[] bytes, string contentType = "image/png", OfficeLength? width = null, OfficeLength? height = null, OfficeLength offsetX = default, OfficeLength offsetY = default, string? name = null, string? altText = null, bool lockAspectRatio = true) #

Creates a template image from bytes.

Parameters

bytes byte[] required
contentType string = "image/png" optional
width OfficeIMO.OfficeLength? = null optional
height OfficeIMO.OfficeLength? = null optional
offsetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
name string? = null optional
altText string? = null optional
lockAspectRatio bool = true optional
public static ExcelTemplateImage FromStream(Stream stream, string contentType = "image/png", OfficeLength? width = null, OfficeLength? height = null, OfficeLength offsetX = default, OfficeLength offsetY = default, string? name = null, string? altText = null, bool lockAspectRatio = true) #

Creates a template image from a stream.

Parameters

stream System.IO.Stream required
contentType string = "image/png" optional
width OfficeIMO.OfficeLength? = null optional
height OfficeIMO.OfficeLength? = null optional
offsetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
name string? = null optional
altText string? = null optional
lockAspectRatio bool = true optional
FromUrlAsync 2 overloads
public static async Task<ExcelTemplateImage> FromUrlAsync(string url, OfficeLength? width = null, OfficeLength? height = null, OfficeLength offsetX = default, OfficeLength offsetY = default, string? name = null, string? altText = null, bool lockAspectRatio = true, CancellationToken cancellationToken = default) #

Asynchronously creates a template image from a remote URL.

Parameters

url string required
width OfficeIMO.OfficeLength? = null optional
height OfficeIMO.OfficeLength? = null optional
offsetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
name string? = null optional
altText string? = null optional
lockAspectRatio bool = true optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ExcelTemplateImage>
public static Task<ExcelTemplateImage> FromUrlAsync(string url, OfficeRemoteImageLoadOptions remoteImageOptions, OfficeLength? width = null, OfficeLength? height = null, OfficeLength offsetX = default, OfficeLength offsetY = default, string? name = null, string? altText = null, bool lockAspectRatio = true, CancellationToken cancellationToken = default) #

Creates a template image using an explicit remote-network policy.

Parameters

url string required
remoteImageOptions OfficeIMO.Drawing.OfficeRemoteImageLoadOptions required
width OfficeIMO.OfficeLength? = null optional
height OfficeIMO.OfficeLength? = null optional
offsetX OfficeIMO.OfficeLength = default optional
offsetY OfficeIMO.OfficeLength = default optional
name string? = null optional
altText string? = null optional
lockAspectRatio bool = true optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ExcelTemplateImage>

Properties

public byte[] Bytes { get; } #

Image bytes when the image is supplied directly.

public string ContentType { get; } #

Image content type, such as image/png or image/jpeg.

public OfficeLength Width { get; } #

Image width as a document length.

public OfficeLength Height { get; } #

Image height as a document length.

public OfficeLength OffsetX { get; } #

Horizontal length offset from the target cell.

public OfficeLength OffsetY { get; } #

Vertical length offset from the target cell.

public string? Name { get; } #

Optional drawing name.

public string? AltText { get; } #

Optional alternative text description.

public bool LockAspectRatio { get; } #

Whether Excel should keep the picture aspect ratio locked.