Class SVGImageRenderer

java.lang.Object
org.apache.poi.xslf.draw.SVGImageRenderer
All Implemented Interfaces:
ImageRenderer

public class SVGImageRenderer extends Object implements ImageRenderer
  • Constructor Details

    • SVGImageRenderer

      public SVGImageRenderer()
  • Method Details

    • loadImage

      public void loadImage(InputStream data, String contentType) throws IOException
      Description copied from interface: ImageRenderer
      Load and buffer the image
      Specified by:
      loadImage in interface ImageRenderer
      Parameters:
      data - the raw image stream
      contentType - the content type
      Throws:
      IOException
    • loadImage

      public void loadImage(byte[] data, String contentType) throws IOException
      Description copied from interface: ImageRenderer
      Load and buffer the image
      Specified by:
      loadImage in interface ImageRenderer
      Parameters:
      data - the raw image bytes
      contentType - the content type
      Throws:
      IOException
    • getBounds

      public Rectangle2D getBounds()
      Specified by:
      getBounds in interface ImageRenderer
      Returns:
      the bounds of the buffered image in pixel
    • setAlpha

      public void setAlpha(double alpha)
      Specified by:
      setAlpha in interface ImageRenderer
      Parameters:
      alpha - the alpha [0..1] to be added to the image (possibly already containing an alpha channel)
    • getImage

      public BufferedImage getImage()
      Specified by:
      getImage in interface ImageRenderer
      Returns:
      the image as buffered image or null if image could not be loaded
    • getImage

      public BufferedImage getImage(Dimension2D dim)
      Specified by:
      getImage in interface ImageRenderer
      Parameters:
      dim - the dimension in pixels of the returned image
      Returns:
      the image as buffered image or null if image could not be loaded
    • drawImage

      public boolean drawImage(Graphics2D graphics, Rectangle2D anchor)
      Description copied from interface: ImageRenderer
      Render picture data into the supplied graphics
      Specified by:
      drawImage in interface ImageRenderer
      Returns:
      true if the picture data was successfully rendered
    • drawImage

      public boolean drawImage(Graphics2D graphics, Rectangle2D anchor, Insets clip)
      Description copied from interface: ImageRenderer
      Render picture data into the supplied graphics
      Specified by:
      drawImage in interface ImageRenderer
      Returns:
      true if the picture data was successfully rendered
    • canRender

      public boolean canRender(String contentType)
      Description copied from interface: ImageRenderer
      Determines if this image renderer implementation supports the given contentType
      Specified by:
      canRender in interface ImageRenderer
      Parameters:
      contentType - the image content type
      Returns:
      if the content type is supported
    • getNativeBounds

      public Rectangle2D getNativeBounds()
      Specified by:
      getNativeBounds in interface ImageRenderer
      Returns:
      the format-specific / not-normalized bounds of the image
    • getSVGRoot

      public org.apache.batik.gvt.GraphicsNode getSVGRoot()