API Reference
ImageBuilder
Builder for images.
Inheritance
- Object
- ImageBuilder
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 ImageBuilder.Add
- Method ImageBuilder.Add
- Method ImageBuilder.Add
- Method ImageBuilder.AddFromUrl
- Method ImageBuilder.AddFromUrlAsync
- Method ImageBuilder.Align
- Method ImageBuilder.Alt
- Method ImageBuilder.BehindText
- Method ImageBuilder.Crop
- Method ImageBuilder.Link
- Method ImageBuilder.MaxWidth
- Method ImageBuilder.Rotate
- Method ImageBuilder.Size
- Method ImageBuilder.Wrap
Accepted by parameters
- Method WordFluentDocument.Image
- Method WordFluentDocument.ImageAsync
Methods
public ImageBuilder Add(String path) #ImageBuilderAdds an image from a file path.
Parameters
- path System.String
- Path to the image file.
public ImageBuilder Add(Stream stream, String fileName) #ImageBuilderAdds an image from a stream.
Parameters
- stream System.IO.Stream
- Stream containing image data.
- fileName System.String
- File name of the image.
public ImageBuilder Add(Byte[] bytes, String fileName) #ImageBuilderAdds an image from a byte array.
Parameters
- bytes System.Byte[]
- Image bytes.
- fileName System.String
- File name of the image.
public ImageBuilder AddFromUrl(String url, CancellationToken cancellationToken = null) #ImageBuilderDownloads and adds an image from a URL.
Parameters
- url System.String
- Image URL.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the download operation.
Returns
The current ImageBuilder.
public async Task<ImageBuilder> AddFromUrlAsync(String url, CancellationToken cancellationToken = null) #Task<ImageBuilder>Asynchronously downloads and adds an image from a URL.
Parameters
- url System.String
- Image URL.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the download operation.
Returns
The current ImageBuilder.
public ImageBuilder Align(HorizontalAlignment alignment) #ImageBuilderSets horizontal alignment for the image's paragraph.
Parameters
- alignment OfficeIMO.HorizontalAlignment
- Desired horizontal alignment.
public ImageBuilder Alt(String title = null, String description = null) #ImageBuilderSets alternative text for the image.
Parameters
- title System.String = null
- Optional title for the image.
- description System.String = null
- Optional description for the image.
public ImageBuilder Crop(Double left, Double top, Double right, Double bottom) #ImageBuilderCrops the image by the specified amounts in centimeters.
Parameters
- left System.Double
- Amount to crop from the left.
- top System.Double
- Amount to crop from the top.
- right System.Double
- Amount to crop from the right.
- bottom System.Double
- Amount to crop from the bottom.
public ImageBuilder Link(String url) #ImageBuilderMakes the image a hyperlink pointing to the specified URL.
Parameters
- url System.String
- Destination URL.
public ImageBuilder MaxWidth(Double width) #ImageBuilderSets the maximum allowed width of the image.
Parameters
- width System.Double
- Maximum width in pixels.
public ImageBuilder Rotate(Double degrees) #ImageBuilderRotates the image by the specified number of degrees.
Parameters
- degrees System.Double
- Rotation angle in degrees.
public ImageBuilder Size(Double width, Nullable<Double> height = null) #ImageBuilderSets the size of the image in pixels.
Parameters
- width System.Double
- Image width in pixels.
- height System.Nullable{System.Double} = null
- Optional image height in pixels.
public ImageBuilder Wrap(WrapTextImage wrapImage) #ImageBuilderApplies a wrapping style to the image.
Parameters
- wrapImage OfficeIMO.Word.WrapTextImage
- Wrapping option.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public WordImage Image { get; } #Gets the image created by the most recent operation.