IImage

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public interface IImage extends System.IDisposable

Represents a raster or vector image.


This interface provides a common abstraction for handling both raster and vector images. Implementations may vary depending on the underlying image type.

Methods

MethodDescription
save(String filename)Saves the image to a file.
save(String filename, int format)Saves the image to a file in the specified format.
save(OutputStream stream, int format)Saves the image to a stream in the specified format.
save(String filename, int format, int quality)Saves the image to a file in the specified format and quality.
save(OutputStream stream, int format, int quality)Saves the image to a stream in the specified format and quality.
getSize()Gets the size of the image.
getWidth()Gets the width of the image in pixels.
getHeight()Gets the height of the image in pixels.

save(String filename)

public abstract void save(String filename)

Saves the image to a file.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe path to the file where the image will be saved.

save(String filename, int format)

public abstract void save(String filename, int format)

Saves the image to a file in the specified format.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe path to the file where the image will be saved.
formatintThe image format.

save(OutputStream stream, int format)

public abstract void save(OutputStream stream, int format)

Saves the image to a stream in the specified format.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe stream where the image will be saved.
formatintThe image format.

save(String filename, int format, int quality)

public abstract void save(String filename, int format, int quality)

Saves the image to a file in the specified format and quality.

Parameters:

ParameterTypeDescription
filenamejava.lang.StringThe path to the file where the image will be saved.
formatintThe image format.
qualityintThe quality of the saved image (0 to 100). This parameter only affects saving in ImageFormat.Jpeg; for all other formats, it is ignored.

save(OutputStream stream, int format, int quality)

public abstract void save(OutputStream stream, int format, int quality)

Saves the image to a stream in the specified format and quality.

Parameters:

ParameterTypeDescription
streamjava.io.OutputStreamThe stream where the image will be saved.
formatintThe image format.
qualityintThe quality of the saved image (0 to 100). This parameter only affects saving in ImageFormat.Jpeg; for all other formats, it is ignored.

getSize()

public abstract Dimension getSize()

Gets the size of the image.

Returns: java.awt.Dimension

getWidth()

public abstract int getWidth()

Gets the width of the image in pixels.

Returns: int

getHeight()

public abstract int getHeight()

Gets the height of the image in pixels.

Returns: int