Package org.apache.batik.transcoder.image

Examples of org.apache.batik.transcoder.image.PNGTranscoder.addTranscodingHint()


                    trans.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
                                             new Boolean(true));

        // Start: By Jun Inamori
        if(isIndexed){
      trans.addTranscodingHint
                            (PNGTranscoder.KEY_INDEXED,new Integer(256));
        }
        // End: By Jun Inamori

                    final BufferedImage img = trans.createImage(w, h);
View Full Code Here


                    // create a BufferedImage of the appropriate type
                    int w = buffer.getWidth();
                    int h = buffer.getHeight();
                    final ImageTranscoder trans = new PNGTranscoder();
                    if (application.getXMLParserClassName() != null) {
                        trans.addTranscodingHint
                            (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
                                application.getXMLParserClassName());
                    }
                    trans.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
                                             Boolean.TRUE );
View Full Code Here

                    if (application.getXMLParserClassName() != null) {
                        trans.addTranscodingHint
                            (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
                                application.getXMLParserClassName());
                    }
                    trans.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
                                             Boolean.TRUE );

            // Start: By Jun Inamori
            if(isIndexed){
                trans.addTranscodingHint(PNGTranscoder.KEY_INDEXED,new Integer(256));
View Full Code Here

                    trans.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
                                             Boolean.TRUE );

            // Start: By Jun Inamori
            if(isIndexed){
                trans.addTranscodingHint(PNGTranscoder.KEY_INDEXED,new Integer(256));
            }
            // End: By Jun Inamori

                    final BufferedImage img = trans.createImage(w, h);
View Full Code Here

   * @throws IOException On write errors
   * @throws TranscoderException On input/parsing errors.
   */
  public void saveAsPNG(File file, int width, int height) throws IOException, TranscoderException {
    PNGTranscoder t = new PNGTranscoder();
    t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width));
    t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
    transcode(file, t);
  }

  /**
 
View Full Code Here

   * @throws TranscoderException On input/parsing errors.
   */
  public void saveAsPNG(File file, int width, int height) throws IOException, TranscoderException {
    PNGTranscoder t = new PNGTranscoder();
    t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width));
    t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
    transcode(file, t);
  }

  /**
   * Transcode file to JPEG.
View Full Code Here

   * @throws IOException On write errors
   * @throws TranscoderException On input/parsing errors.
   */
  public void saveAsPNG(File file, int width, int height) throws IOException, TranscoderException {
    PNGTranscoder t = new PNGTranscoder();
    t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width));
    t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
    transcode(file, t);
  }

  /**
 
View Full Code Here

   * @throws TranscoderException On input/parsing errors.
   */
  public void saveAsPNG(File file, int width, int height) throws IOException, TranscoderException {
    PNGTranscoder t = new PNGTranscoder();
    t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, new Float(width));
    t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
    transcode(file, t);
  }

  /**
   * Transcode file to JPEG.
View Full Code Here

   */
  public boolean convert( String name, InputStream is, OutputStream os, int width, int height )
  {
    try {
      PNGTranscoder trans = new PNGTranscoder();
      trans.addTranscodingHint( PNGTranscoder.KEY_WIDTH, new Float( width ));
      trans.addTranscodingHint( PNGTranscoder.KEY_HEIGHT, new Float( height ));           
      TranscoderInput input = new TranscoderInput( is );
      TranscoderOutput output = new TranscoderOutput( os );
      trans.transcode( input, output );
      os.flush();
View Full Code Here

  public boolean convert( String name, InputStream is, OutputStream os, int width, int height )
  {
    try {
      PNGTranscoder trans = new PNGTranscoder();
      trans.addTranscodingHint( PNGTranscoder.KEY_WIDTH, new Float( width ));
      trans.addTranscodingHint( PNGTranscoder.KEY_HEIGHT, new Float( height ));           
      TranscoderInput input = new TranscoderInput( is );
      TranscoderOutput output = new TranscoderOutput( os );
      trans.transcode( input, output );
      os.flush();
      os.close();
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.