public final class WmfImage extends VectorImageResourceBase
Represents one vector image in WMF (Windows MetaFile) format with its metadata and additional methods
Disposed
Constructor and Description |
---|
WmfImage(String name,
InputStream binaryContent)
Creates new WmfImage instance from content, represented as byte stream,
and with specified name
|
WmfImage(String name,
com.aspose.ms.System.IO.Stream binaryContent) |
WmfImage(String name,
String contentInBase64)
Creates new WmfImage instance from content, represented as base64-encoded
string, and with specified name
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this WMF image by disposing its content and making most its
methods and properties non-working
|
InputStream |
getByteContent()
Returns a content of this WMF image as a binary stream
|
com.aspose.ms.System.IO.Stream |
getByteContentInternal() |
String |
getTextContent()
Returns a content of this WMF image as a plain text
|
ImageType |
getType()
Returns ImageType.Wmf
|
static boolean |
isValid(InputStream binaryContent)
Checks whether specified stream is a valid WMF image
|
static boolean |
isValid(String contentInBase64)
Checks whether specified base64-encoded string is a valid WMF image
|
static boolean |
isValidInternal(com.aspose.ms.System.IO.Stream binaryContent) |
void |
save(String fullPathToFile)
Saves this WMF image to the file
|
void |
saveToPng(InputStream outputPngContent)
Saves this vector WMF image into raster PNG image
|
void |
saveToPngInternal(com.aspose.ms.System.IO.Stream outputPngContent) |
void |
saveToSvg(InputStream outputSvgContent)
Saves this vector WMF image into vector SVG image
|
void |
saveToSvgInternal(com.aspose.ms.System.IO.Stream outputSvgContent) |
equals, getAspectRatio, getFilenameWithExtension, getLinearDimensions, getName, isDisposed
public WmfImage(String name, InputStream binaryContent)
Creates new WmfImage instance from content, represented as byte stream, and with specified name
name
- Name of the WMF image. Cannot be null, empty or whitespaces.binaryContent
- Content as byte stream. Reading begins from original
position. Cannot be null. Should be readable and seekable. If this
instance will be disposed, this stream will be disposed too.com.aspose.ms.System.ArgumentException
com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
public WmfImage(String name, com.aspose.ms.System.IO.Stream binaryContent)
public WmfImage(String name, String contentInBase64)
Creates new WmfImage instance from content, represented as base64-encoded string, and with specified name
name
- Name of the WMF image. Cannot be null, empty or whitespaces.contentInBase64
- Content as base64-encoded string. Cannot be null,
empty or whitespaces. If it is not a WMF content, exception will be
thrown.com.aspose.ms.System.ArgumentException
com.groupdocs.editor.htmlcss.exceptions.InvalidImageFormatException
public void dispose()
Disposes this WMF image by disposing its content and making most its methods and properties non-working
dispose
in interface com.aspose.ms.System.IDisposable
dispose
in class VectorImageResourceBase
public InputStream getByteContent()
Returns a content of this WMF image as a binary stream
getByteContent
in interface IHtmlResource
getByteContent
in class VectorImageResourceBase
public com.aspose.ms.System.IO.Stream getByteContentInternal()
getByteContentInternal
in interface IHtmlResource
getByteContentInternal
in class VectorImageResourceBase
public String getTextContent()
Returns a content of this WMF image as a plain text
getTextContent
in interface IHtmlResource
getTextContent
in class VectorImageResourceBase
public ImageType getType()
Returns ImageType.Wmf
getType
in interface IHtmlResource
getType
in interface IImageResource
getType
in class VectorImageResourceBase
public static boolean isValid(InputStream binaryContent)
Checks whether specified stream is a valid WMF image
binaryContent
- Input byte stream. Cannot be NULL, should support
reading and seeking.public static boolean isValid(String contentInBase64)
Checks whether specified base64-encoded string is a valid WMF image
contentInBase64
- Input string, where content of WMF image is stored
in base64 encoding. Cannot be NULL or empty.public static boolean isValidInternal(com.aspose.ms.System.IO.Stream binaryContent)
public void save(String fullPathToFile)
Saves this WMF image to the file
save
in interface IHtmlResource
save
in class VectorImageResourceBase
fullPathToFile
- Full path to the file, which will be created (if it
doesn't exist) or overwritten (if exists) with the content of this WMF
imagepublic final void saveToPng(InputStream outputPngContent)
Saves this vector WMF image into raster PNG image
outputPngContent
- Output stream, into which the content of PNG
image will be written. Cannot be NULL and should be writeable.public void saveToPngInternal(com.aspose.ms.System.IO.Stream outputPngContent)
public final void saveToSvg(InputStream outputSvgContent)
Saves this vector WMF image into vector SVG image
outputSvgContent
- Output stream, into which the content of SVG
image will be written. Cannot be NULL and should be writeable.public void saveToSvgInternal(com.aspose.ms.System.IO.Stream outputSvgContent)