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 |
|---|---|
protected String |
_base64TextContent
Content of the image in base64-encoded form, stored in the string
|
protected com.aspose.ms.System.IO.Stream |
_binaryContent
Content of the image in the stream
|
protected boolean |
_isDisposed
Flag, which indicates, whether this image is disposed
|
protected boolean |
_isOwnStream
true if stream was created internally within inheritor (usually because
original content was base64 string) and should be disposed; false if
stream was passed from outside and should not be touched.
|
protected Dimensions |
_linearDimensions
Linear dimensions of the image
|
protected String |
_name
Name of the raster image, which serves as its unique identifier.
|
protected long |
_streamOrigPosition
Original position in the stream, which indicates the beginning of the
image content
|
Event<EventHandler> |
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.
|
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
|
boolean |
isDisposed()
Determines whether this raster image is disposed or not
|
void |
save(String fullPathToFile)
Saves this raster image to the specified file
|
protected String _base64TextContent
Content of the image in base64-encoded form, stored in the string
protected com.aspose.ms.System.IO.Stream _binaryContent
Content of the image in the stream
protected boolean _isDisposed
Flag, which indicates, whether this image is disposed
protected boolean _isOwnStream
true if stream was created internally within inheritor (usually because original content was base64 string) and should be disposed; false if stream was passed from outside and should not be touched.
protected Dimensions _linearDimensions
Linear dimensions of the image
protected String _name
Name of the raster image, which serves as its unique identifier. Should not be changed (readonly) after creating an instance of the class.
protected long _streamOrigPosition
Original position in the stream, which indicates the beginning of the image content
public final Event<EventHandler> Disposed
public final void dispose()
Disposes this raster image, disposing its content and making most methods and properties non-working
dispose in interface IDisposablepublic final boolean equals(IHtmlResource other)
Checks this instance with specified on reference equality.
other - Other IHtmlResource inheritorpublic final Ratio getAspectRatio()
Returns an aspect ratio of this image as the width-to-height relation
getAspectRatio in interface IImageResourcepublic final InputStream getByteContent()
Returns content of this raster image as byte stream
getByteContent in interface IHtmlResourcepublic final String getFilenameWithExtension()
Returns correct filename of this raster image, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension in interface IHtmlResourcepublic final int getLength()
Returns the length of this raster image file in bytes
public final Dimensions getLinearDimensions()
Returns linear dimensions of this raster image (width and height)
getLinearDimensions in interface IImageResourcepublic final String getName()
Returns name of this raster image. Usually doesn't contain filename extension and theoretically can differ from filename.
getName in interface IHtmlResourcepublic final String getTextContent()
Returns content of this raster image as base64-encoded string
getTextContent in interface IHtmlResourcepublic abstract ImageType getType()
In implementing type should return information about type of the raster image
getType in interface IHtmlResourcegetType in interface IImageResourcepublic final boolean isDisposed()
Determines whether this raster image is disposed or not
isDisposed in interface IAuxDisposablepublic final void save(String fullPathToFile)
Saves this raster image to the specified file
save in interface IHtmlResourcefullPathToFile - Full path to the file, which will be created or
rewrittenCopyright © 2024. All rights reserved.