ImageData

Overview

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

Defines an image for a shape.

Edition status of its 53 listed members (a property and its accessor methods are listed separately, overloads once): 53 not yet exercised by a verified example.

This class declares 39 methods for ImageData objects in Java programs. Available methods include: fitImageToShape, getBiLevel, getBorders, getBrightness, getChromaKey, getContrast, getCropBottom, getCropLeft, getCropRight, getCropTop, getGrayScale, getImageBytes, and 24 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: biLevel, borders, brightness, chromaKey, contrast, cropBottom, and 11 more.

Properties

NameTypeAccessDescription
imageBytesbyte[]Read/WriteGets or sets the image bytes.
imageSizeImageSizeReadGets the information about image size and resolution.
imageTypeintReadGets the type of the image.
linkbooleanReadReturns true if the image is linked to the shape (when SourceFullName is specified).
linkOnlybooleanReadReturns 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.
biLevelbooleanRead/WriteDetermines whether an image will be displayed in black and white.
grayScalebooleanRead/WriteDetermines whether a picture will display in grayscale mode.

Methods

SignatureDescription
setImage(image: BufferedImage)Sets the image that the shape displays.
setImage(stream: java.io.InputStream)Sets the image value.
setImage(fileName: String)Sets the image that the shape displays.
toImage() → BufferedImageGets the image stored in the shape as a java BufferedImage object.
toStream() → java.io.InputStreamCalls toStream on this ImageData instance.
toByteArray() → byte[]Returns image bytes for any image regardless whether the image is stored or linked.
save(stream: java.io.OutputStream)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.
getImageBytes() → byte[]Returns the image bytes.
setImageBytes(value: byte[])Sets the image bytes value.
hasImage() → booleanReturns true if the shape has image bytes or links an image.
getImageSize() → ImageSizeGets the information about image size and resolution.
getImageType() → intGets the type of the image.
isLink() → booleanReturns true if the image is linked to the shape (when SourceFullName is specified).
isLinkOnly() → booleanReturns true if the image is linked and not stored in the document.
getSourceFullName() → StringGets or sets the path and name of the source file for the linked image.
setSourceFullName(value: String)Sets the source full name value.
getTitle() → StringDefines the title of an image.
setTitle(value: String)Sets the title value.
getCropTop() → doubleDefines the fraction of picture removal from the top side.
setCropTop(value: double)Sets the crop top value.
getCropBottom() → doubleDefines the fraction of picture removal from the bottom side.
setCropBottom(value: double)Sets the crop bottom value.
getCropLeft() → doubleDefines the fraction of picture removal from the left side.
setCropLeft(value: double)Sets the crop left value.
getCropRight() → doubleDefines the fraction of picture removal from the right side.
setCropRight(value: double)Sets the crop right value.
getBorders() → BorderCollectionGets the collection of borders of the image.
getChromaKey() → ColorDefines the color value of the image that will be treated as transparent.
setChromaKey(value: Color)Sets the chroma key value.
getBrightness() → doubleGets or sets the brightness of the picture.
setBrightness(value: double)Sets the brightness value.
getContrast() → doubleGets or sets the contrast for the specified picture.
setContrast(value: double)Sets the contrast value.
getBiLevel() → booleanDetermines whether an image will be displayed in black and white.
setBiLevel(value: boolean)Sets the bi level value.
getGrayScale() → booleanDetermines whether a picture will display in grayscale mode.
setGrayScale(value: boolean)Sets the gray scale value.

See Also