Package org.apache.batik.refimpl.transcoder

Examples of org.apache.batik.refimpl.transcoder.PngTranscoder


                final File f = fileChooser.getSelectedFile();
                BufferedImage buffer = canvas.getBuffer();
                // create a BufferedImage of the appropriate type
                int w = buffer.getWidth();
                int h = buffer.getHeight();
                final ImageTranscoder trans = new PngTranscoder();
                final BufferedImage img = trans.createImage(w, h);
                // paint the buffer to the image
                Graphics2D g2d = img.createGraphics();
                g2d.drawImage(buffer, null, 0, 0);
                new Thread() {
                    public void run() {
                        try {
                            currentExportPath = f.getCanonicalPath();
                            OutputStream ostream =
                              new BufferedOutputStream(new FileOutputStream(f));
                            trans.writeImage(img, ostream);
                            ostream.flush();
                            ostream.close();
                            statusBar.setMessage(
                                resources.getString("Document.export"));
                        } catch (IOException ex) { }
View Full Code Here

TOP

Related Classes of org.apache.batik.refimpl.transcoder.PngTranscoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.