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

Examples of org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder


   */
  public void saveTIFFWithBatik(String filename, BufferedImage image) {
    File outfile = new File(filename);
    OutputStream fos = createFile(outfile);
    TIFFEncodeParam param = new TIFFEncodeParam();
    TIFFImageEncoder encoder = new TIFFImageEncoder(fos, param);
    try {
      encoder.encode(image);
    } catch (Exception e) {
      // do nothing
    } finally {
      try {
        fos.close();
View Full Code Here


                          new long[][] {rational})
                };
        renderParams.setExtraFields(fields);

        // Creates encoder
        TIFFImageEncoder enc = new TIFFImageEncoder(outputStream, renderParams);

        // Creates lazy iterator over generated page images
        Iterator pageImagesItr = new LazyPageImagesIterator(getNumberOfPages(), log);

        // The first image to be passed to enc
        RenderedImage first = (RenderedImage) pageImagesItr.next();

        // The other images are set to the renderParams
        renderParams.setExtraImages(pageImagesItr);

        // Start encoding
        enc.encode(first);

        // Cleaning
        outputStream.flush();
        clearViewportList();
        log.debug("Tiff encoding done.");
View Full Code Here

                          new long[][] {rational})
                };
        renderParams.setExtraFields(fields);

        // Creates encoder
        TIFFImageEncoder enc = new TIFFImageEncoder(outputStream, renderParams);

        // Creates lazy iterator over generated page images
        Iterator pageImagesItr = new LazyPageImagesIterator(getNumberOfPages(), log);

        // The first image to be passed to enc
        RenderedImage first = (RenderedImage) pageImagesItr.next();

        // The other images are set to the renderParams
        renderParams.setExtraImages(pageImagesItr);

        // Start encoding
        enc.encode(first);

        // Cleaning
        outputStream.flush();
        clearViewportList();
        log.debug("Tiff encoding done.");
View Full Code Here

TOP

Related Classes of org.apache.batik.ext.awt.image.codec.tiff.TIFFImageEncoder

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.