public final class XImage extends Object
Class representing image X-Object.
Modifier and Type | Class and Description |
---|---|
static class |
XImage.RawParameters
Class representing image raw XImage parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsTransparency()
If the image contains transparancy than return true; otherwise, false.
|
void |
delete()
Deletes image from the parent collection.
|
int |
getColorType()
Returns color type of image.
|
com.aspose.pdf.engine.data.IPdfDataStream |
getEngineImg()
IPdfImage object which decribes image.
|
BufferedImage |
getGrayscaled()
Gets grayscaled version of image.
|
int |
getHeight()
Gets height of the image.
|
com.aspose.ms.System.Drawing.Bitmap |
getImage()
For internal use only
|
String |
getName()
Gets image name.
|
String |
getNameInCollection()
Returns name of the image in its collection.
|
byte[] |
getRawBytes()
Returns raw bytes for the image without decoding.
|
XImage.RawParameters |
getRawParameters()
Gets raw image parameters
|
int |
getWidth()
Gets width of the image.
|
static boolean |
isImage(com.aspose.pdf.engine.data.IPdfPrimitive primitive)
Returns true if the primitive is an image.
|
boolean |
isTheSameObject(XImage image)
Returns true if both images references to the same object.
|
void |
replace(InputStream image)
Replaces image onto stream specified in
image . |
void |
save(OutputStream stream)
Saves image data into stream as JPEG image.
|
void |
save(OutputStream stream,
float xDpi,
float yDpi)
Saves image into stream with requested format.
|
void |
save(OutputStream stream,
ImageType format)
Saves image into stream with requested format.
|
void |
save(OutputStream stream,
ImageType format,
int resolution)
Saves image into stream with requested format.
|
void |
save(OutputStream stream,
int resolution)
Saves image into stream with requested format with specified resolution.
|
void |
saveInternal(com.aspose.ms.System.IO.Stream stream,
ImageType format,
int resolution) |
void |
saveInternal(com.aspose.ms.System.IO.Stream stream,
int resolution)
Saves image data into stream as JPEG image with specified resolution.
|
void |
setName(String value)
Sets image name.
|
InputStream |
toStream()
Returns the original image stream.
|
String |
toString()
Returns a string representation XImage object properties.
|
public boolean containsTransparency()
If the image contains transparancy than return true; otherwise, false.
public BufferedImage getGrayscaled()
Gets grayscaled version of image.
public void delete()
Deletes image from the parent collection.
public void replace(InputStream image)
Replaces image onto stream specified in image
.
image
- Stream with image data.public com.aspose.pdf.engine.data.IPdfDataStream getEngineImg()
IPdfImage object which decribes image. Internal only
public int getWidth()
Gets width of the image.
public int getHeight()
Gets height of the image.
public String getName()
Gets image name.
public void setName(String value)
Sets image name.
value
- String valuepublic void save(OutputStream stream)
Saves image data into stream as JPEG image.
stream
- Stream where image data will be saved.public void save(OutputStream stream, float xDpi, float yDpi)
Saves image into stream with requested format.
stream
- OutputStream where image will be savedxDpi
- Image horizontal resolutionyDpi
- Image vertical resolutionpublic void save(OutputStream stream, ImageType format)
Saves image into stream with requested format.
stream
- Stream where image will be savedformat
- Format which will be used for image enconding.ImageType
public com.aspose.ms.System.Drawing.Bitmap getImage()
public void saveInternal(com.aspose.ms.System.IO.Stream stream, int resolution)
Saves image data into stream as JPEG image with specified resolution.
stream
- Stream where image data will be saved.resolution
- Image resolutionpublic void save(OutputStream stream, int resolution)
Saves image into stream with requested format with specified resolution.
stream
- Stream where image will be savedresolution
- Image resolutionpublic void saveInternal(com.aspose.ms.System.IO.Stream stream, ImageType format, int resolution)
public void save(OutputStream stream, ImageType format, int resolution)
Saves image into stream with requested format.
stream
- Stream where image will be savedformat
- Format which will be used for image enconding.resolution
- Image resolutionImageType
public static boolean isImage(com.aspose.pdf.engine.data.IPdfPrimitive primitive)
Returns true if the primitive is an image.
primitive
- IPdfPrimitivepublic int getColorType()
Returns color type of image.
public boolean isTheSameObject(XImage image)
Returns true if both images references to the same object.
image
- Image to be compared with "this" image.public String getNameInCollection()
Returns name of the image in its collection.
public XImage.RawParameters getRawParameters()
public String toString()
public byte[] getRawBytes()
public InputStream toStream()
Returns the original image stream.