|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.imaging.DisposableObject
com.aspose.imaging.DataStreamSupporter
com.aspose.imaging.Image
public abstract class Image
The image is the base class for all type of images.
Constructor Summary | |
---|---|
protected |
Image()
Initializes a new instance of the Image class. |
protected |
Image(IColorPalette colorPalette,
boolean useCompactPalette)
Initializes a new instance of the Image class. |
Method Summary | |
---|---|
static boolean |
canLoad(java.io.InputStream stream)
|
static boolean |
canLoad(java.io.InputStream stream,
LoadOptionsBase loadOptions)
|
static boolean |
canLoad(java.lang.String filePath)
Determines whether image can be loaded from the specified file path. |
static boolean |
canLoad(java.lang.String filePath,
LoadOptionsBase loadOptions)
Determines whether image can be loaded from the specified file path and optionally using the specified open options. |
boolean |
canSave(SaveOptionsBase saveOptions)
Determines whether image can be saved to the specified file format represented by the passed save options. |
static Image |
create(ImageCreateOptions imageCreateOptions)
Creates a new image using the specified create options. |
abstract int |
getBitsPerPixel()
Gets the image bits per pixel count. |
Rectangle |
getBounds()
Gets the image bounds. |
Image |
getContainer()
Gets the Image container. |
static long |
getFileFormat(java.io.InputStream stream)
Gets the file format. |
static long |
getFileFormat(java.lang.String filePath)
Gets the file format. |
protected Rectangle |
getFitRectangle(Rectangle rectangle)
Gets rectangle which fits the current image. |
protected Rectangle |
getFitRectangle(Rectangle rectangle,
Color[] pixels)
Gets rectangle which fits the current bitmap taking into account the pixels passed. |
static Rectangle |
getFittingRectangle(Rectangle rectangle,
Color[] pixels,
int width,
int height)
Gets rectangle which fits the current image. |
static Rectangle |
getFittingRectangle(Rectangle rectangle,
int width,
int height)
Gets rectangle which fits the current image. |
abstract int |
getHeight()
Gets the image height. |
abstract java.lang.String |
getImageLoaderDescriptorName()
Gets the name of the image loader descriptor. |
IColorPalette |
getPalette()
Gets or sets the color palette. |
Size |
getSize()
Gets the image size. |
boolean |
getUseCompactPalette()
Gets or sets a value indicating whether compact palette is used. |
abstract int |
getWidth()
Gets the image width. |
static Image |
load(java.io.InputStream stream)
Loads a new image from the InputStream. |
static Image |
load(java.lang.String filePath)
Loads a new image from the specified file. |
protected void |
onCompactPaletteUsageChanged()
Called when compact palette usage is changed. |
protected void |
onPaletteChanged(IColorPalette oldPalette,
IColorPalette newPalette)
Called when palette is changed. |
protected void |
onPaletteChanging(IColorPalette oldPalette,
IColorPalette newPalette)
Called when palette is changing. |
void |
resize(int newWidth,
int newHeight)
Resizes the image. |
abstract void |
resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image. |
abstract void |
rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image. |
void |
save(java.io.InputStream stream,
SaveOptionsBase saveOptions)
|
void |
save(java.io.OutputStream stream)
|
void |
save(java.lang.String filePath,
SaveOptionsBase saveOptions)
Saves the object's data to the specified file location in the specified file format according to save options. |
void |
setContainer(Image container)
Sets the Image container. |
void |
setPalette(IColorPalette value)
|
abstract void |
setPalette(IColorPalette palette,
boolean updateColors)
Sets the image palette. |
void |
setUseCompactPalette(boolean value)
|
Methods inherited from class com.aspose.imaging.DataStreamSupporter |
---|
flush, getDataStreamContainer, onDataStreamContainerChanging, releaseManagedResources, save, save, setDataStreamContainer |
Methods inherited from class com.aspose.imaging.DisposableObject |
---|
dispose, getDisposed, releaseUnmanagedResources, verifyNotDisposed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Image()
Initializes a new instance of the Image
class.
protected Image(IColorPalette colorPalette, boolean useCompactPalette)
Initializes a new instance of the Image
class.
colorPalette
- The color palette.useCompactPalette
- if set to true
compact palette is used.Method Detail |
---|
public static boolean canLoad(java.io.InputStream stream)
public static boolean canLoad(java.io.InputStream stream, LoadOptionsBase loadOptions)
public static boolean canLoad(java.lang.String filePath)
Determines whether image can be loaded from the specified file path.
filePath
- The file path.
true
if image can be loaded from the specified file; otherwise, false
.public static boolean canLoad(java.lang.String filePath, LoadOptionsBase loadOptions)
Determines whether image can be loaded from the specified file path and optionally using the specified open options.
filePath
- The file path.loadOptions
- The load options.
true
if image can be loaded from the specified file; otherwise, false
.public boolean canSave(SaveOptionsBase saveOptions)
Determines whether image can be saved to the specified file format represented by the passed save options.
public static Image create(ImageCreateOptions imageCreateOptions)
Creates a new image using the specified create options.
imageCreateOptions
- The image create options.
public abstract int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.
public Rectangle getBounds()
Gets the image bounds.
Value: The image bounds.
getBounds
in interface IObjectWithBounds
public Image getContainer()
Gets the Image
container.
Image
container.
public static long getFileFormat(java.io.InputStream stream)
Gets the file format.
stream
- The stream.public static long getFileFormat(java.lang.String filePath)
Gets the file format.
filePath
- The file path.
protected Rectangle getFitRectangle(Rectangle rectangle)
Gets rectangle which fits the current image.
rectangle
- The rectangle to get fitting rectangle for.
protected Rectangle getFitRectangle(Rectangle rectangle, Color[] pixels)
Gets rectangle which fits the current bitmap taking into account the pixels passed. The passed pixels array count should be equal to the fitting rectangle size.
rectangle
- The rectangle to get fitting rectangle for.pixels
- The pixels array.
public static Rectangle getFittingRectangle(Rectangle rectangle, Color[] pixels, int width, int height)
Gets rectangle which fits the current image.
rectangle
- The rectangle to get fitting rectangle for.pixels
- The pixels.width
- The object width.height
- The object height.
public static Rectangle getFittingRectangle(Rectangle rectangle, int width, int height)
Gets rectangle which fits the current image.
rectangle
- The rectangle to get fitting rectangle for.width
- The object width.height
- The object height.
public abstract int getHeight()
Gets the image height.
Value: The image height.
getHeight
in interface IObjectWithBounds
public abstract java.lang.String getImageLoaderDescriptorName()
Gets the name of the image loader descriptor.
Value: The name of the image loader descriptor.
public IColorPalette getPalette()
Gets or sets the color palette.
Value: The color palette.
public Size getSize()
Gets the image size.
Value: The image size.
getSize
in interface IObjectWithBounds
public boolean getUseCompactPalette()
Gets or sets a value indicating whether compact palette is used.
Value:true
if compact palette is used; otherwise, false
.
public abstract int getWidth()
Gets the image width.
Value: The image width.
getWidth
in interface IObjectWithBounds
public static Image load(java.io.InputStream stream)
Loads a new image from the InputStream.
public static Image load(java.lang.String filePath)
Loads a new image from the specified file.
filePath
- The file path to load image from.
protected void onCompactPaletteUsageChanged()
Called when compact palette usage is changed.
protected void onPaletteChanged(IColorPalette oldPalette, IColorPalette newPalette)
Called when palette is changed.
oldPalette
- The old palette.newPalette
- The new palette.protected void onPaletteChanging(IColorPalette oldPalette, IColorPalette newPalette)
Called when palette is changing.
oldPalette
- The old palette.newPalette
- The new palette.public void resize(int newWidth, int newHeight)
Resizes the image. The default ResizeType.LeftTopToLeftTop
is used.
newWidth
- The new width.newHeight
- The new height.public abstract void resize(int newWidth, int newHeight, int resizeType)
Resizes the image.
newWidth
- The new width.newHeight
- The new height.resizeType
- The resize type.public abstract void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
rotateFlipType
- Type of the rotate flip.public void save(java.io.InputStream stream, SaveOptionsBase saveOptions)
public void save(java.io.OutputStream stream)
public void save(java.lang.String filePath, SaveOptionsBase saveOptions)
Saves the object's data to the specified file location in the specified file format according to save options.
filePath
- The file path.saveOptions
- The save options.public void setContainer(Image container)
Sets the Image
container.
container
- The Image
container.public void setPalette(IColorPalette value)
public abstract void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
palette
- The palette to set.updateColors
- if set to true
colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries.public void setUseCompactPalette(boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |