RasterImageResourceBase
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.editor.htmlcss.resources.images.IImageResource
public abstract class RasterImageResourceBase implements IImageResource
Base class for any supported raster image with fixed name, dimensions, aspect ratio, type, size, and content.
Constructors
| Constructor | Description |
|---|---|
| RasterImageResourceBase() |
Fields
| Field | Description |
|---|---|
| Disposed |
Methods
| Method | Description |
|---|---|
| getName() | Returns name of this raster image. |
| getFilenameWithExtension() | Returns correct filename of this raster image, which consists of name and extension. |
| getLinearDimensions() | Returns linear dimensions of this raster image (width and height) |
| getAspectRatio() | Returns an aspect ratio of this image as the width-to-height relation |
| getLength() | Returns the length of this raster image file in bytes |
| getByteContent() | Returns content of this raster image as byte stream |
| getTextContent() | Returns content of this raster image as base64-encoded string |
| save(String fullPathToFile) | Saves this raster image to the specified file |
| equals(IHtmlResource other) | Checks this instance with specified on reference equality. |
| dispose() | Disposes this raster image, disposing its content and making most methods and properties non-working |
| isDisposed() | Determines whether this raster image is disposed or not |
| getType() | In implementing type should return information about type of the raster image |
RasterImageResourceBase()
public RasterImageResourceBase()
Disposed
public final Event<EventHandler> Disposed
getName()
public final String getName()
Returns name of this raster image. Usually doesn’t contain filename extension and theoretically can differ from filename.
Returns: java.lang.String
getFilenameWithExtension()
public final String getFilenameWithExtension()
Returns correct filename of this raster image, which consists of name and extension. Theoretically can differ from the name.
Returns: java.lang.String
getLinearDimensions()
public final Dimensions getLinearDimensions()
Returns linear dimensions of this raster image (width and height)
Returns: Dimensions
getAspectRatio()
public final Ratio getAspectRatio()
Returns an aspect ratio of this image as the width-to-height relation
Returns: Ratio
getLength()
public final int getLength()
Returns the length of this raster image file in bytes
Returns: int -
getByteContent()
public final InputStream getByteContent()
Returns content of this raster image as byte stream
Returns: java.io.InputStream -
getTextContent()
public final String getTextContent()
Returns content of this raster image as base64-encoded string
Returns: java.lang.String -
save(String fullPathToFile)
public final void save(String fullPathToFile)
Saves this raster image to the specified file
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullPathToFile | java.lang.String | Full path to the file, which will be created or rewritten |
equals(IHtmlResource other)
public final boolean equals(IHtmlResource other)
Checks this instance with specified on reference equality.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| other | IHtmlResource | Other IHtmlResource inheritor |
Returns: boolean - True if are equal, false if are unequal
dispose()
public final void dispose()
Disposes this raster image, disposing its content and making most methods and properties non-working
isDisposed()
public final boolean isDisposed()
Determines whether this raster image is disposed or not
Returns: boolean -
getType()
public abstract ImageType getType()
In implementing type should return information about type of the raster image
Returns: ImageType -