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
| Name | Type | Access | Description |
|---|---|---|---|
imageBytes | byte[] | Read/Write | Gets or sets the image bytes. |
imageSize | ImageSize | Read | Gets the information about image size and resolution. |
imageType | int | Read | Gets the type of the image. |
link | boolean | Read | Returns true if the image is linked to the shape (when SourceFullName is specified). |
linkOnly | boolean | Read | Returns true if the image is linked and not stored in the document. |
sourceFullName | String | Read/Write | Gets or sets the path and name of the source file for the linked image. |
title | String | Read/Write | Defines the title of an image. |
cropTop | double | Read/Write | Defines the fraction of picture removal from the top side. |
cropBottom | double | Read/Write | Defines the fraction of picture removal from the bottom side. |
cropLeft | double | Read/Write | Defines the fraction of picture removal from the left side. |
cropRight | double | Read/Write | Defines the fraction of picture removal from the right side. |
borders | BorderCollection | Read | Gets the collection of borders of the image. |
chromaKey | Color | Read/Write | Defines the color value of the image that will be treated as transparent. |
brightness | double | Read/Write | Gets or sets the brightness of the picture. |
contrast | double | Read/Write | Gets or sets the contrast for the specified picture. |
biLevel | boolean | Read/Write | Determines whether an image will be displayed in black and white. |
grayScale | boolean | Read/Write | Determines whether a picture will display in grayscale mode. |
Methods
| Signature | Description |
|---|---|
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() → BufferedImage | Gets the image stored in the shape as a java BufferedImage object. |
toStream() → java.io.InputStream | Calls 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() → boolean | Returns true if the shape has image bytes or links an image. |
getImageSize() → ImageSize | Gets the information about image size and resolution. |
getImageType() → int | Gets the type of the image. |
isLink() → boolean | Returns true if the image is linked to the shape (when SourceFullName is specified). |
isLinkOnly() → boolean | Returns true if the image is linked and not stored in the document. |
getSourceFullName() → String | Gets or sets the path and name of the source file for the linked image. |
setSourceFullName(value: String) | Sets the source full name value. |
getTitle() → String | Defines the title of an image. |
setTitle(value: String) | Sets the title value. |
getCropTop() → double | Defines the fraction of picture removal from the top side. |
setCropTop(value: double) | Sets the crop top value. |
getCropBottom() → double | Defines the fraction of picture removal from the bottom side. |
setCropBottom(value: double) | Sets the crop bottom value. |
getCropLeft() → double | Defines the fraction of picture removal from the left side. |
setCropLeft(value: double) | Sets the crop left value. |
getCropRight() → double | Defines the fraction of picture removal from the right side. |
setCropRight(value: double) | Sets the crop right value. |
getBorders() → BorderCollection | Gets the collection of borders of the image. |
getChromaKey() → Color | Defines the color value of the image that will be treated as transparent. |
setChromaKey(value: Color) | Sets the chroma key value. |
getBrightness() → double | Gets or sets the brightness of the picture. |
setBrightness(value: double) | Sets the brightness value. |
getContrast() → double | Gets or sets the contrast for the specified picture. |
setContrast(value: double) | Sets the contrast value. |
getBiLevel() → boolean | Determines whether an image will be displayed in black and white. |
setBiLevel(value: boolean) | Sets the bi level value. |
getGrayScale() → boolean | Determines whether a picture will display in grayscale mode. |
setGrayScale(value: boolean) | Sets the gray scale value. |