ImageData

Overview

ImageData is a class in Aspose.Words FOSS for .NET. Inherits from: IBorderAttrSource.

This class provides 9 methods for working with ImageData objects in .NET programs. Available methods include: FitImageToShape, Save, SetImage, ToByteArray, ToImage, ToStream. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package. Properties: BiLevel, Borders, Brightness, ChromaKey, Contrast, CropBottom, and 12 more.

Properties

NameTypeAccessDescription
ImageBytesbyte[]Read/WriteGets or sets the image bytes.
HasImageboolReadReturns true if the shape has image bytes or links an image.
ImageSizeImageSizeReadGets the information about image size and resolution.
ImageTypeImageTypeReadGets the type of the image.
IsLinkboolReadReturns true if the image is linked to the shape (when SourceFullName is specified).
IsLinkOnlyboolReadReturns true if the image is linked and not stored in the document.
SourceFullNamestringRead/WriteGets or sets the path and name of the source file for the linked image.
TitlestringRead/WriteDefines the title of an image.
CropTopdoubleRead/WriteDefines the fraction of picture removal from the top side.
CropBottomdoubleRead/WriteDefines the fraction of picture removal from the bottom side.
CropLeftdoubleRead/WriteDefines the fraction of picture removal from the left side.
CropRightdoubleRead/WriteDefines the fraction of picture removal from the right side.
BordersBorderCollectionReadGets the collection of borders of the image.
ChromaKeyColorRead/WriteDefines the color value of the image that will be treated as transparent.
BrightnessdoubleRead/WriteGets or sets the brightness of the picture.
ContrastdoubleRead/WriteGets or sets the contrast for the specified picture.
BiLevelboolRead/WriteDetermines whether an image will be displayed in black and white.
GrayScaleboolRead/WriteDetermines whether a picture will display in grayscale mode.

Methods

SignatureDescription
SetImage(image: Image)Sets the image that the shape displays.
SetImage(stream: Stream)Sets the image value.
SetImage(fileName: string)Sets the image that the shape displays.
ToImage()Gets the image stored in the shape as a Imagejava BufferedImageImage object.
ToStream()Calls ToStream on this ImageData instance.
ToByteArray()Returns image bytes for any image regardless whether the image is stored or linked.
Save(stream: Stream)Calls Save(stream) on this ImageData instance.
Save(fileName: string)Saves the image into a file.
FitImageToShape()Fits the image data to Shape frame so that the aspect ratio of the image data matches the aspect ratio of Shape frame.

See Also