Examples of PNGImageEncoder


Examples of com.sun.media.jai.codecimpl.PNGImageEncoder

      outputStream = new ByteArrayOutputStream();
      if (lowFormat.startsWith("png")) {
        PNGEncodeParam pngParam = PNGEncodeParam
            .getDefaultEncodeParam(image);
        pngParam.setPhysicalDimension(dpi * 3937, dpi * 3937, 100);
        PNGImageEncoder pngEncoder = new PNGImageEncoder(outputStream,
            pngParam);
        pngEncoder.encode(image);
      } else if ("jpg".equals(lowFormat) || "jpeg".equals(lowFormat)) {
        JPEGEncodeParam jpgParam = JPEGCodec
            .getDefaultJPEGEncodeParam(image);
        jpgParam.setXDensity(dpi);
        jpgParam.setYDensity(dpi);
View Full Code Here

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

                BufferedImage diff =
                    SVGRenderingAccuracyTest.buildDiffImage(ref, img);
                String s = new File(filename).getName();
                s = ("test-references/org/apache/batik/transcoder/image/"+
                     "candidate-variation/"+s);
                PNGImageEncoder encoder
                    = new PNGImageEncoder
                    (new FileOutputStream(s),
                     PNGEncodeParam.getDefaultEncodeParam(diff));
                encoder.encode(diff);
                report.addDescriptionEntry(DIFFERENCE_IMAGE,new File(s));
            } catch (Exception e) { }
        }
View Full Code Here

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

        throws IOException {
        if(!imgFile.exists()){
            imgFile.createNewFile();
        }

        PNGImageEncoder encoder
            = new PNGImageEncoder(new FileOutputStream(imgFile),
                                  PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
    }
View Full Code Here

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

            imageFile = makeRandomFileName(imageType);
        }
       
        imageFile.deleteOnExit();

        PNGImageEncoder encoder
            = new PNGImageEncoder(new FileOutputStream(imageFile),
                                  PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
       
        return imageFile;
       
    }
View Full Code Here

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

        // num Pixs in 1 Meter
        int numPix      = (int)((1000/PixSzMM)+0.5);
        params.setPhysicalDimension(numPix, numPix, 1); // 1 means 'pix/meter'

        try {
            PNGImageEncoder pngEncoder = new PNGImageEncoder(ostream, params);
            pngEncoder.encode(img);
            ostream.close();
        } catch (IOException ex) {
            throw new TranscoderException(ex);
        }
    }
View Full Code Here

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

        throws IOException {
        if(!imgFile.exists()){
            imgFile.createNewFile();
        }

        PNGImageEncoder encoder
            = new PNGImageEncoder(new FileOutputStream(imgFile),
                                  PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
    }
View Full Code Here

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

            imageFile = makeRandomFileName(imageType);
        }
       
        imageFile.deleteOnExit();

        PNGImageEncoder encoder
            = new PNGImageEncoder(new FileOutputStream(imageFile),
                                  PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
       
        return imageFile;
       
    }
View Full Code Here

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

        // num Pixs in 1 Meter
        int numPix      = (int)((1000/PixSzMM)+0.5);
        params.setPhysicalDimension(numPix, numPix, 1); // 1 means 'pix/meter'

        try {
            PNGImageEncoder pngEncoder = new PNGImageEncoder(ostream, params);
            pngEncoder.encode(img);
            ostream.close();
        } catch (IOException ex) {
            throw new TranscoderException(ex);
        }
    }
View Full Code Here

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

                p += adjust;
            }
        }

        try {
            PNGImageEncoder pngEncoder = new PNGImageEncoder(ostream, params);
            pngEncoder.encode(img);
            ostream.close();
        } catch (IOException ex) {
            throw new TranscoderException(ex);
        }
    }
View Full Code Here

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

        throws IOException {
        if(!imgFile.exists()){
            imgFile.createNewFile();
        }

        PNGImageEncoder encoder
            = new PNGImageEncoder(new FileOutputStream(imgFile),
                                  PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.