XImageCollection
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.Iterable
public final class XImageCollection implements Iterable<XImage>
Class representing XImage collection.
Methods
Method | Description |
---|---|
size() | Count of images in collection. |
isSynchronized() | Returns true if object is synchronized. |
getSyncRoot() | Returns synchronization object. |
getNames() | Gets array of image names. |
isReadOnly() | Gets a value indicating whether the collection is read-only. |
add(XImage image) | Adds new image to Image list. |
add(InputStream image) | Adds entity to the end of the collection, so entity can be accessed by the last index. |
add(BufferedImage image) | Adds entity to the end of the collection, so entity can be accessed by the last index. |
addWithImageFilterType(InputStream image, int filterType) | Adds entity to the end of the collection, so entity can be accessed by the last index. |
add(InputStream image, int quality) | Adds entity to the end of the collection, so entity can be accessed by the last index. |
delete(int index) | Removes index from collection by index. |
delete(int index, int action) | Removes index from collection by index performing action specified by action parameter. |
delete(String name) | Removes item from collection by name. |
delete(String name, int action) | Removes item from collection by name. |
delete() | Deletes images from collection. |
iterator() | Returns collection enumerator. |
copyTo(XImage[] array, int index) | Copies array of images into collection. |
replace(int index, InputStream stream) | Replace image in collection with another image. |
replace(int index, InputStream stream, int quality, boolean isBlackAndWhite) | Replace image in collection with another image. |
replace(int index, InputStream stream, int quality) | Replace image in collection with another image. |
get_Item(int index) | Gets image from collection by its index. |
get_Item(String name) | Gets image from collection by its name. |
hasImage(String imgName) | |
getImageName(XImage image) | Returns name in images list which is key of the given image. |
clear() | Clears all items from the collection. |
contains(XImage item) | Determines whether the collection contains a specific value. |
remove(XImage item) | Not supported yet, throws exception. |
size()
public int size()
Count of images in collection.
Returns: int - int value
isSynchronized()
public boolean isSynchronized()
Returns true if object is synchronized.
Returns: boolean - boolean value
getSyncRoot()
public Object getSyncRoot()
Returns synchronization object.
Returns: java.lang.Object - Object element
getNames()
public String[] getNames()
Gets array of image names.
Returns: java.lang.String[] - String[] array
isReadOnly()
public boolean isReadOnly()
Gets a value indicating whether the collection is read-only.
Returns: boolean - boolean value
add(XImage image)
public String add(XImage image)
Adds new image to Image list. This method adds image as reference to the same PdfObject (which allows to decrease file size)
Parameters:
Parameter | Type | Description |
---|---|---|
image | XImage | XImage to be added. |
Returns: java.lang.String - Name of the added image.
add(InputStream image)
public String add(InputStream image)
Adds entity to the end of the collection, so entity can be accessed by the last index.
Parameters:
Parameter | Type | Description |
---|---|---|
image | java.io.InputStream | Stream containing image data (in JPEG format). |
Returns: java.lang.String - Name of the added image.
add(BufferedImage image)
public String add(BufferedImage image)
Adds entity to the end of the collection, so entity can be accessed by the last index.
Parameters:
Parameter | Type | Description |
---|---|---|
image | java.awt.image.BufferedImage | BufferedImage containing image data. |
Returns: java.lang.String - Name of the added image.
addWithImageFilterType(InputStream image, int filterType)
public String addWithImageFilterType(InputStream image, int filterType)
Adds entity to the end of the collection, so entity can be accessed by the last index.
Parameters:
Parameter | Type | Description |
---|---|---|
image | java.io.InputStream | Stream containing image data. |
filterType | int | The image filter type. |
Returns: java.lang.String - Name of the added image.
add(InputStream image, int quality)
public String add(InputStream image, int quality)
Adds entity to the end of the collection, so entity can be accessed by the last index.
Parameters:
Parameter | Type | Description |
---|---|---|
image | java.io.InputStream | Stream containing image data (in JPEG format). |
quality | int | JPEG quality. |
Returns: java.lang.String - Name of the added image.
delete(int index)
public void delete(int index)
Removes index from collection by index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Image index. |
delete(int index, int action)
public final void delete(int index, int action)
Removes index from collection by index performing action specified by action parameter.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of the image to be removed. |
action | int | ImageDeleteAction element. Action performed after image deleting. |
delete(String name)
public void delete(String name)
Removes item from collection by name.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | Name of image which must to be deleted. |
delete(String name, int action)
public final void delete(String name, int action)
Removes item from collection by name.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | Name of image which must to be deleted. |
action | int | Action to be performed with image object. |
delete()
public void delete()
Deletes images from collection.
iterator()
public Iterator<XImage> iterator()
Returns collection enumerator.
Returns: java.util.Iterator<com.aspose.pdf.XImage> - Enumerator of collection
copyTo(XImage[] array, int index)
public void copyTo(XImage[] array, int index)
Copies array of images into collection.
Parameters:
Parameter | Type | Description |
---|---|---|
array | XImage[] | Array to be copied. |
index | int | Index where images will be copied into collection. |
replace(int index, InputStream stream)
public void replace(int index, InputStream stream)
Replace image in collection with another image.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of collection item which will be replaced. |
stream | java.io.InputStream | Stream containing image data (in JPEG format). |
replace(int index, InputStream stream, int quality, boolean isBlackAndWhite)
public final void replace(int index, InputStream stream, int quality, boolean isBlackAndWhite)
Replace image in collection with another image.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of collection item which will be replaced. |
stream | java.io.InputStream | Stream containing image data (in JPEG format). |
quality | int | Quality of JPEG compression, in percent (valid vaues are 0..100). |
isBlackAndWhite | boolean | If true, image is compressed with CCITT compression method which provides better compression for black nad white image. May be used only for black and white images. |
replace(int index, InputStream stream, int quality)
public void replace(int index, InputStream stream, int quality)
Replace image in collection with another image.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of collection item which will be replaced. |
stream | java.io.InputStream | Stream containing image data (in JPEG format). |
quality | int | JPEG quality. |
get_Item(int index)
public XImage get_Item(int index)
Gets image from collection by its index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Image index |
Returns: XImage - Retrieved image.
get_Item(String name)
public XImage get_Item(String name)
Gets image from collection by its name.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | Image name. |
Returns: XImage - Retrieved image.
hasImage(String imgName)
public boolean hasImage(String imgName)
Parameters:
Parameter | Type | Description |
---|---|---|
imgName | java.lang.String |
Returns: boolean
getImageName(XImage image)
public String getImageName(XImage image)
Returns name in images list which is key of the given image.
Parameters:
Parameter | Type | Description |
---|---|---|
image | XImage | Image to search. |
Returns: java.lang.String - Name (key) of the found image; null if images was not found.
clear()
public void clear()
Clears all items from the collection.
contains(XImage item)
public boolean contains(XImage item)
Determines whether the collection contains a specific value.
Parameters:
Parameter | Type | Description |
---|---|---|
item | XImage | The object to locate in the collection |
Returns: boolean - true if item is found in the collection; otherwise, false.
remove(XImage item)
public boolean remove(XImage item)
Not supported yet, throws exception.
Always throws NotImplementedException
Parameters:
Parameter | Type | Description |
---|---|---|
item | XImage | XImage instance Item to remove. |
Returns: boolean - boolean value