OfficeIMO

API Reference

Class

ImageBuilder

Namespace OfficeIMO.Word.Fluent
Assembly OfficeIMO.Word

Builder for images.

Inheritance

  • Object
  • ImageBuilder

Methods

Add 3 overloads
public ImageBuilder Add(String path) #
Returns: ImageBuilder

Adds an image from a file path.

Parameters

path System.String requiredposition: 0
Path to the image file.
public ImageBuilder Add(Stream stream, String fileName) #
Returns: ImageBuilder

Adds an image from a stream.

Parameters

stream System.IO.Stream requiredposition: 0
Stream containing image data.
fileName System.String requiredposition: 1
File name of the image.
public ImageBuilder Add(Byte[] bytes, String fileName) #
Returns: ImageBuilder

Adds an image from a byte array.

Parameters

bytes System.Byte[] requiredposition: 0
Image bytes.
fileName System.String requiredposition: 1
File name of the image.
public ImageBuilder AddFromUrl(String url, CancellationToken cancellationToken = null) #
Returns: ImageBuilder

Downloads and adds an image from a URL.

Parameters

url System.String requiredposition: 0
Image URL.
cancellationToken System.Threading.CancellationToken = null optionalposition: 1
Token used to cancel the download operation.

Returns

The current ImageBuilder.

public async Task<ImageBuilder> AddFromUrlAsync(String url, CancellationToken cancellationToken = null) #
Returns: Task<ImageBuilder>

Asynchronously downloads and adds an image from a URL.

Parameters

url System.String requiredposition: 0
Image URL.
cancellationToken System.Threading.CancellationToken = null optionalposition: 1
Token used to cancel the download operation.

Returns

The current ImageBuilder.

public ImageBuilder Align(HorizontalAlignment alignment) #
Returns: ImageBuilder

Sets horizontal alignment for the image's paragraph.

Parameters

alignment OfficeIMO.HorizontalAlignment requiredposition: 0
Desired horizontal alignment.
public ImageBuilder Alt(String title = null, String description = null) #
Returns: ImageBuilder

Sets alternative text for the image.

Parameters

title System.String = null optionalposition: 0
Optional title for the image.
description System.String = null optionalposition: 1
Optional description for the image.
public ImageBuilder BehindText() #
Returns: ImageBuilder

Places the image behind text.

public ImageBuilder Crop(Double left, Double top, Double right, Double bottom) #
Returns: ImageBuilder

Crops the image by the specified amounts in centimeters.

Parameters

left System.Double requiredposition: 0
Amount to crop from the left.
top System.Double requiredposition: 1
Amount to crop from the top.
right System.Double requiredposition: 2
Amount to crop from the right.
bottom System.Double requiredposition: 3
Amount to crop from the bottom.
public ImageBuilder MaxWidth(Double width) #
Returns: ImageBuilder

Sets the maximum allowed width of the image.

Parameters

width System.Double requiredposition: 0
Maximum width in pixels.
public ImageBuilder Rotate(Double degrees) #
Returns: ImageBuilder

Rotates the image by the specified number of degrees.

Parameters

degrees System.Double requiredposition: 0
Rotation angle in degrees.
public ImageBuilder Size(Double width, Nullable<Double> height = null) #
Returns: ImageBuilder

Sets the size of the image in pixels.

Parameters

width System.Double requiredposition: 0
Image width in pixels.
height System.Nullable{System.Double} = null optionalposition: 1
Optional image height in pixels.
public ImageBuilder Wrap(WrapTextImage wrapImage) #
Returns: ImageBuilder

Applies a wrapping style to the image.

Parameters

wrapImage OfficeIMO.Word.WrapTextImage requiredposition: 0
Wrapping option.

Properties

public WordImage Image { get; } #

Gets the image created by the most recent operation.