com.aspose.metafiles
Class WmfMetafile

java.lang.Object
  extended by com.aspose.metafiles.Metafile
      extended by com.aspose.metafiles.WmfMetafile
All Implemented Interfaces:
java.awt.image.renderable.RenderableImage

public final class WmfMetafile
extends Metafile

Represents WMF Metafile.


Field Summary
 
Fields inherited from interface java.awt.image.renderable.RenderableImage
HINTS_OBSERVED
 
Constructor Summary
WmfMetafile(java.io.InputStream stream)
          This constructor is the primary mechanism to read existing metafile from a stream.
WmfMetafile(java.lang.String fileName)
          This constructor is the primary mechanism to read existing presentation from a file.
 
Method Summary
 java.awt.image.RenderedImage createRendering(java.awt.image.renderable.RenderContext rc)
          Creates RenderedImage from the metafile.
 java.awt.Rectangle getBounds()
          Returns metafile's bounds.
 MetafileComment[] getComments()
          Returns comments stored in a metafile.
 void playMetafile(java.awt.Graphics2D target)
          Draws a metafile without transform to the specified Graphics2D object.
 void playMetafile(java.awt.Graphics2D target, java.awt.geom.AffineTransform trans)
          Draws a metafile to the specified Graphics2D object with transformation.
 
Methods inherited from class com.aspose.metafiles.Metafile
createDefaultRendering, createScaledRendering, getDefaultRenderingHints, getEmbeddedBitmaps, getHeight, getMaxPixelCount, getMinPixelCount, getMinX, getMinY, getProperty, getPropertyNames, getSources, getTextOutOperations, getTextStrings, getWidth, isDynamic, LoadMetafile, LoadMetafile, setDefaultRenderingHints, setMaxPixelCount, setMinPixelCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WmfMetafile

public WmfMetafile(java.io.InputStream stream)
            throws MetafilesException
This constructor is the primary mechanism to read existing metafile from a stream.

Parameters:
stream - - the input stream.
Throws:
MetafilesException

WmfMetafile

public WmfMetafile(java.lang.String fileName)
            throws MetafilesException,
                   java.io.FileNotFoundException
This constructor is the primary mechanism to read existing presentation from a file.

Parameters:
fileName - - name of a file.
Throws:
MetafilesException
java.io.FileNotFoundException
Method Detail

getBounds

public java.awt.Rectangle getBounds()
Returns metafile's bounds.
Note: this rectangle is not an image size. To obtain image size and position use getMinX(), getMinY(), getWidth() and getHeight().

Specified by:
getBounds in class Metafile
Returns:
metafile's bounds.

playMetafile

public void playMetafile(java.awt.Graphics2D target)
                  throws MetafilesException
Draws a metafile without transform to the specified Graphics2D object.

Specified by:
playMetafile in class Metafile
Parameters:
target - - Graphics2D object.
Throws:
MetafilesException

playMetafile

public void playMetafile(java.awt.Graphics2D target,
                         java.awt.geom.AffineTransform trans)
                  throws MetafilesException
Draws a metafile to the specified Graphics2D object with transformation.

Specified by:
playMetafile in class Metafile
Parameters:
target - - Graphics2D object.
trans - - coordinates transformation from metafile's coordinates to Graphics2D user space.
Throws:
MetafilesException

createRendering

public java.awt.image.RenderedImage createRendering(java.awt.image.renderable.RenderContext rc)
Creates RenderedImage from the metafile.

Parameters:
rc - - RenderContext object used to create image.

getComments

public MetafileComment[] getComments()
Returns comments stored in a metafile.

Specified by:
getComments in class Metafile
Returns:
array of comments.