org.apache.batik.refimpl.transcoder
Class PngTranscoder

java.lang.Object
  |
  +--org.apache.batik.refimpl.transcoder.AbstractTranscoder
        |
        +--org.apache.batik.refimpl.transcoder.ImageTranscoder
              |
              +--org.apache.batik.refimpl.transcoder.PngTranscoder
All Implemented Interfaces:
Transcoder

public class PngTranscoder
extends ImageTranscoder

An ImageTranscoder that produces a png image. The default background color is transparent.


Fields inherited from class org.apache.batik.refimpl.transcoder.AbstractTranscoder
hints
 
Constructor Summary
PngTranscoder()
          Constructs a new png transcoder.
 
Method Summary
 java.awt.image.BufferedImage createImage(int w, int h)
          Creates a new image of type ARGB with the specified dimension.
 java.lang.String getMimeType()
          Returns the png mime type image/png.
 void writeImage(java.awt.image.BufferedImage img, java.io.OutputStream ostream)
          Writes the specified image as a png to the specified ouput stream.
 
Methods inherited from class org.apache.batik.refimpl.transcoder.ImageTranscoder
transcodeToStream
 
Methods inherited from class org.apache.batik.refimpl.transcoder.AbstractTranscoder
addTranscodingHint, getBackgroundPaint, getDefaultViewport, getGVTBuilder, getParserClassName, getTranscodingHints, setTranscodingHints, transcodeToStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PngTranscoder

public PngTranscoder()
Constructs a new png transcoder.
Method Detail

createImage

public java.awt.image.BufferedImage createImage(int w,
                                                int h)
Creates a new image of type ARGB with the specified dimension.
Overrides:
createImage in class ImageTranscoder
Parameters:
w - the width of the image
h - the height of the image

writeImage

public void writeImage(java.awt.image.BufferedImage img,
                       java.io.OutputStream ostream)
                throws java.io.IOException
Writes the specified image as a png to the specified ouput stream.
Overrides:
writeImage in class ImageTranscoder
Parameters:
img - the image to write
ostream - the output stream where to write the image

getMimeType

public java.lang.String getMimeType()
Returns the png mime type image/png.


Copyright © 2000 Apache Software Foundation. All Rights Reserved.