Package org.apache.batik.ext.awt.image.codec

Examples of org.apache.batik.ext.awt.image.codec.PNGImageEncoder


            // num Pixs in 1 Meter
            int numPix = (int)((1000 / pixSzMM) + 0.5);
            renderParams.setPhysicalDimension(numPix, numPix, 1); // 1 means 'pix/meter'
           
            // Encode PNG image
            PNGImageEncoder encoder = new PNGImageEncoder(os, renderParams);
            encoder.encode(image);
            os.flush();
        }
    }
View Full Code Here


        // Encode this image
        log.debug("Encoding page" + (getCurrentPageNumber() + 1));
        renderParams = PNGEncodeParam.getDefaultEncodeParam(image);
        OutputStream os = getCurrentOutputStream(getCurrentPageNumber());
        PNGImageEncoder encoder = new PNGImageEncoder(os, renderParams);
        encoder.encode(image);
        os.flush();

        setCurrentPageNumber(getCurrentPageNumber() + 1);
    }
View Full Code Here

     * @throws IOException in case of an I/O problem
     */
    public static void saveAsPNG(BufferedImage bitmap, File outputFile) throws IOException {
        OutputStream out = new FileOutputStream(outputFile);
        try {
            PNGImageEncoder encoder = new PNGImageEncoder(
                    out,
                    PNGEncodeParam.getDefaultEncodeParam(bitmap));
            encoder.encode(bitmap);
        } finally {
            IOUtils.closeQuietly(out);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.batik.ext.awt.image.codec.PNGImageEncoder

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.