public abstract class RasterImageResourceBase extends Object implements IImageResource
Base class for any supported raster image with fixed name, dimensions, aspect ratio, type, size, and content.
Modifier and Type | Field and Description |
---|---|
com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> |
Disposed
Event, which occurs when this raster image is disposed
|
Constructor and Description |
---|
RasterImageResourceBase() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this raster image, disposing its content and making most methods and properties non-working
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified on reference equality.
|
boolean |
equals(Object obj)
Determines whether the specified Object is equal to the current Object.
|
BufferedImage |
generateBitmap()
Generates and returns a new instance of the 'System.Drawing.Bitmap' from this raster image.
|
Ratio |
getAspectRatio()
Returns an aspect ratio of this image as the width-to-height relation
|
InputStream |
getByteContent()
Returns content of this raster image as byte stream
|
String |
getFilenameWithExtension()
Returns correct filename of this raster image, which consists of name and extension.
|
int |
getLength()
Returns the length of this raster image file in bytes
|
Dimensions |
getLinearDimensions()
Returns linear dimensions of this raster image (width and height)
|
String |
getName()
Returns name of this raster image.
|
String |
getTextContent()
Returns content of this raster image as base64-encoded string
|
abstract ImageType |
getType()
In implementing type should return information about type of the raster image
|
int |
hashCode()
Serves as a hash function for a particular type.
|
boolean |
isDisposed()
Determines whether this raster image is disposed or not
|
RasterImageResourceBase |
reduceToNewHeight(int targetHeightInPixels)
Creates and returns a new reduced image resource of the same type, but with specified new reduced height and proportionally reduced width.
|
void |
save(String fullPathToFile)
Saves this raster image to the specified file
|
public final com.groupdocs.editor.events.ProcessEvents<com.groupdocs.editor.events.ProcessEventHandler> Disposed
Event, which occurs when this raster image is disposed
public void dispose()
Disposes this raster image, disposing its content and making most methods and properties non-working
dispose
in interface com.aspose.ms.System.IDisposable
public boolean equals(IHtmlResource other)
Checks this instance with specified on reference equality.
other
- IHtmlResourcepublic boolean equals(Object obj)
Determines whether the specified Object is equal to the current Object.
public BufferedImage generateBitmap()
Generates and returns a new instance of the 'System.Drawing.Bitmap' from this raster image.
public Ratio getAspectRatio()
Returns an aspect ratio of this image as the width-to-height relation
getAspectRatio
in interface IImageResource
public InputStream getByteContent()
Returns content of this raster image as byte stream
getByteContent
in interface IHtmlResource
public String getFilenameWithExtension()
Returns correct filename of this raster image, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension
in interface IHtmlResource
public int getLength()
Returns the length of this raster image file in bytes
public Dimensions getLinearDimensions()
Returns linear dimensions of this raster image (width and height)
getLinearDimensions
in interface IImageResource
public String getName()
Returns name of this raster image. Usually doesn't contain filename extension and theoretically can differ from filename.
getName
in interface IHtmlResource
public String getTextContent()
Returns content of this raster image as base64-encoded string
getTextContent
in interface IHtmlResource
public abstract ImageType getType()
In implementing type should return information about type of the raster image
getType
in interface IHtmlResource
getType
in interface IImageResource
public int hashCode()
Serves as a hash function for a particular type.
public boolean isDisposed()
Determines whether this raster image is disposed or not
isDisposed
in interface IAuxDisposable
public RasterImageResourceBase reduceToNewHeight(int targetHeightInPixels) throws Exception
Creates and returns a new reduced image resource of the same type, but with specified new reduced height and proportionally reduced width.
targetHeightInPixels
- Height of the desired image in pixels. Should be strictly lesser than original height.Exception
public void save(String fullPathToFile)
Saves this raster image to the specified file
save
in interface IHtmlResource
fullPathToFile
- Full path to the file, which will be created or rewritedCopyright © 2018. All rights reserved.