Packages

 

com.aspose.imaging.fileformats.metafile

Class WmfMetafileImage

    • Method Detail

      • createWmfRecorderGraphics

        public static WmfRecorderGraphics2D createWmfRecorderGraphics(Rectangle frame,
                                                                      int dpi)
        Creates a WmfRecorderGraphics2D object to record a WMF metafile
        Parameters:
        frame - metafile's frame.
        dpi - metafile's resolution
        Returns:
        created WmfRecorderGraphics2D object
      • createWmfRecorderGraphics

        public static WmfRecorderGraphics2D createWmfRecorderGraphics(Rectangle frame,
                                                                      int dpi,
                                                                      Charset charset,
                                                                      GraphicObjectConverter converter)
        Creates a WmfRecorderGraphics2D object to record a WMF metafile
        Parameters:
        frame - metafile's frame.
        dpi - metafile's resolution
        converter - callback object used to convert Paint, Stroke and Composite objects to the GDI objects.
        Returns:
        created WmfRecorderGraphics2D object
      • setDeviceSize

        public void setDeviceSize(Dimension deviceSize)
        Changes device size for nonplaceable metafiles. This value used for rendering and not saved to a file. If metafile is placeable does nothing.
        Parameters:
        deviceSize - - new device size
      • setDpi

        public void setDpi(float dpi)
        Changes device (both horizontal and vertical) for nonplaceable metafiles. This value used for rendering and not saved to a file.
        Parameters:
        dpi - - new dpi.
      • setVerticalDpi

        public void setVerticalDpi(float dpi)
        Changes device vertical for nonplaceable metafiles. This value used for rendering and not saved to a file. Use this method after the setDpi and only to specify different resolution for vertical axis.
        Parameters:
        dpi - - new vertical dpi.
      • convertToNonplaceable

        public void convertToNonplaceable()
        Removes placeable header from metafile.
      • convertToPlaceable

        public void convertToPlaceable(Rectangle frame,
                                       short mupi)
        Adds placeable header to the metafile.
        Parameters:
        frame - - metafile's frame in metafile's units.
        mupi - - number of metafile's units per inch.
      • isPlaceable

        public boolean isPlaceable()
        Returns true if WMF metafile has placeable header.
      • getBounds

        public 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 interface IObjectWithBounds
        Specified by:
        getBounds in class MetafileImage
        Returns:
        metafile's bounds.
      • getMuFrame

        public Rectangle getMuFrame()
        Returns metafile's position and size in internal metafile units. Note: in most cases you don't need this. See getMinX(), getMinY(), getWidth() and getHeight() instead.
        Returns:
        metafile's rectangle.
      • getDpi

        public float getDpi()
        Returns metafile's DPI.
      • getMupi

        public float getMupi()
        Returns number of metafile's units per inch. Note: in most cases you don't need this. See getDpi instead.
      • getEmbeddedMetafiles

        public List<EmfMetafileImage> getEmbeddedMetafiles()
        Returns EMF images embedded into the WMF file.
        Returns:
        A list of EMF images if they are present in the file, or an empty list otherwise.
      • createRendering

        public RenderedImage createRendering(RenderContext rc)
        Creates RenderedImage from the metafile.
        Parameters:
        rc - - RenderContext object used to create image.
      • wrap

        public static WmfMetafileImage wrap(byte[] imageData)
                                     throws MetafilesException
        Creates a new WmfMetafileImage containing specified raster image. Image will not be reencoded. Note: passing JPEG or PNG image to this function is possible, but not recomended because most of GDI drivers, including windows screen don't support JPEG and PNG images.
        Parameters:
        imageData - - byte array containing image.
        Returns:
        created metafile.
        Throws:
        MetafilesException
      • getWatermarkDrawer

        public com.aspose.imaging.fileformats.metafile.MetafileRecorderGraphics2D getWatermarkDrawer()

        Returns the custom watermark drawer

        Specified by:
        getWatermarkDrawer in class MetafileImage
        Returns:
        Graphics2D watermark drawer.
      • getMissedFonts

        public String[] getMissedFonts()
        Description copied from class: MetafileImage
        Returns the list of fonts which used inside metafile but not found.
        Specified by:
        getMissedFonts in class MetafileImage
        Returns:
        Font list