public abstract class ImageFormat extends FormatBase
Represents base abstraction for image files.
Modifier | Constructor and Description |
---|---|
protected |
ImageFormat(InputStream input)
Initializes a new instance of the
ImageFormat class. |
protected |
ImageFormat(InputStream input,
com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the
ImageFormat class. |
protected |
ImageFormat(String fileName)
Initializes a new instance of the
ImageFormat class. |
protected |
ImageFormat(String fileName,
com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the
ImageFormat class. |
Modifier and Type | Method and Description |
---|---|
void |
cleanMetadata()
Removes writable metadata properties associated with the image.
|
static ImageFormat |
fromFile(String fileName)
Creates
ImageFormat from a file. |
static ImageFormat |
fromFile(String fileName,
Charset encoding)
Creates
ImageFormat from a file. |
static ImageFormat |
fromStream(InputStream stream)
Creates
ImageFormat from a stream. |
int |
getByteOrder()
Gets the byte-order of the image.
|
int |
getHeight()
Gets the image height.
|
int |
getWidth()
Gets the image width.
|
close, dispose, dispose, getMetadata, getMIMEType, getType, readByMetadataKey, save, save, save
protected ImageFormat(String fileName)
Initializes a new instance of the ImageFormat
class.
fileName
- A string that contains the full name of the file from which to create an ImageFormat
instance.protected ImageFormat(String fileName, com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the ImageFormat
class.
fileName
- A string that contains the full name of the file from which to create an ImageFormat
instance.encoding
- The encoding to be used for text metadata with unknown encoding.protected ImageFormat(InputStream input)
Initializes a new instance of the ImageFormat
class.
input
- A stream that contains the data for this ImageFormat
.protected ImageFormat(InputStream input, com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the ImageFormat
class.
input
- A stream that contains the data for this ImageFormat
.encoding
- The encoding to be used for text metadata with unknown encoding.public int getWidth()
Gets the image width.
public int getHeight()
Gets the image height.
public final int getByteOrder()
Gets the byte-order of the image.
Please see <a href="https://en.wikipedia.org/wiki/Endianness">https://en.wikipedia.org/wiki/Endianness</a>
for more information.
public static ImageFormat fromFile(String fileName)
Creates ImageFormat
from a file.
fileName
- A string that contains the full name of the file from which to create a ImageFormat
instance.ImageFormat
class.public static ImageFormat fromFile(String fileName, Charset encoding)
Creates ImageFormat
from a file.
fileName
- A string that contains the full name of the file from which to create a ImageFormat
instance.encoding
- The encoding to be used for text metadata with unknown encoding.ImageFormat
class.public static ImageFormat fromStream(InputStream stream)
Creates ImageFormat
from a stream.
stream
- A stream that contains the data for this ImageFormat
.ImageFormat
class.public void cleanMetadata()
Removes writable metadata properties associated with the image.
cleanMetadata
in class FormatBase
Copyright © 2019. All rights reserved.