Package com.idrsolutions.image.wmf
Class WmfDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.wmf.WmfDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class WmfDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class reads WMF images as BufferedImage.
Make NO assumptions about the type of
BufferedImage type returned (it may change)
Example 1 (Using raw byte data):
WmfDecoder decoder = new WmfDecoder();
BufferedImage decodedImage = decoder.read(wmfByteData);
Example 2 (Using File):
File wmfFile = new File("C:\\path\\to\\output\\file.png");
WmfDecoder decoder = new WmfDecoder();
BufferedImage decodedImage = decoder.read(wmfFile);
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread
(byte[] data) Decodes and returns the WMF file as a BufferedImage from a filereadDimension
(byte[] wmfRawData) Decodes and returns the width and height of wmf imagereadDimension
(File file) Decodes and returns the width and height of wmf imagestatic void
toSVG
(FileInputStream wmfInputStream, FileOutputStream svgOutputFile) static void
-
Constructor Details
-
Method Details
-
read
Decodes and returns the WMF file as a BufferedImage from a file- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- input image file to be decoded- Returns:
- BufferedImage decoded image
- Throws:
IOException
- if an error occurs in reading image
-
read
- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Throws:
Exception
-
readDimension
Decodes and returns the width and height of wmf image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
file
- image image contained in raw data if present- Returns:
- width and height of image
- Throws:
Exception
- if problem reading image
-
readDimension
Decodes and returns the width and height of wmf image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
wmfRawData
- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
Exception
- if problem reading image
-
toSVG
- Throws:
IOException
-
toSVG
public static void toSVG(FileInputStream wmfInputStream, FileOutputStream svgOutputFile) throws IOException - Throws:
IOException
-