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

Examples of org.apache.batik.ext.awt.image.codec.PNGImageEncoder.encode()


    response.setContentType("image/jpg");

    param = PNGEncodeParam.getDefaultEncodeParam(bufferedImage);
    captchaPNGImage = new PNGImageEncoder(response.getOutputStream(), param);

    captchaPNGImage.encode(bufferedImage);
    }

    /*
    * This helper method is used for drawing a thick line on the image.
    */
 
View Full Code Here


     */
    public void encodeImage(BufferedImage buf, OutputStream os)
            throws IOException {
        Base64EncoderStream b64Encoder = new Base64EncoderStream(os);
        ImageEncoder encoder = new PNGImageEncoder(b64Encoder, null);
        encoder.encode(buf);
        b64Encoder.close();
    }

    public int getBufferedImageType(){
        return BufferedImage.TYPE_INT_ARGB;
View Full Code Here

            }
        }

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

            }
        }

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

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

    /**
     * Builds a new BufferedImage that is the difference between the two input images
     */
 
View Full Code Here

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

                     "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

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

    protected void saveImage(BufferedImage img, OutputStream os)
        throws IOException {
        PNGImageEncoder encoder = new PNGImageEncoder
            (os, PNGEncodeParam.getDefaultEncodeParam(img));
       
        encoder.encode(img);
    }

    /**
     * Builds a new BufferedImage that is the difference between the
     * two input images
View Full Code Here

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

    /**
 
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.