Package javax.imageio

Examples of javax.imageio.ImageWriter.dispose()


            Graphics g = rendImage.createGraphics();
            g.drawImage(image, 0, 0, null);
        }
        writer.write(new IIOImage(rendImage, null, null));
        ios.flush();
        writer.dispose();
    } // saveImage

    /**
     * Loads an Image.
     *
 
View Full Code Here


    imageWriter.setOutput( imageOutputStream );
    imageWriter.write( null, new IIOImage( bufferedImage, null, null ), params );

    imageOutputStream.close();

    imageWriter.dispose();
  }
}

View Full Code Here

        IIOImage image = new IIOImage(tile, null, null);
        try {
            writer.write(null, image, param);
        } finally {
            imgOut.close();
            writer.dispose();
        }

        return true;
    }
View Full Code Here

                // Write the image
                writer.write(null, new IIOImage(newImage, null, null), param);

                // Cleanup
                ios.flush();
                writer.dispose();
                ios.close();

                newdata = out.toByteArray();
            } else {
                mLog.severe("No JPEG-Exporter found. Image is not stored in Data");
View Full Code Here

                iwparam.setCompressionQuality(jpegQuality);//Set here your compression rate
                ImageWriter iw = ImageIO.getImageWritersByFormatName("jpg").next();
                ImageOutputStream ios = ImageIO.createImageOutputStream(baos);
                iw.setOutput(ios);
                iw.write(null, new IIOImage(scaled, null, null), iwparam);
                iw.dispose();
                ios.close();

                scaled.flush();
                scaled = null;
                image = com.itextpdf.text.Image.getInstance(baos.toByteArray());
View Full Code Here

            }
            ImageOutputStream ios = javax.imageio.ImageIO.createImageOutputStream(baos);
            imageWriter.setOutput(ios);
            imageWriter.write(new IIOImage(bufferedImage, null, null));
            ios.flush();
            imageWriter.dispose();
            return baos.toByteArray();
        } catch (IOException e) {
            throw ExceptionFactory.makeWebServiceException(e);
        }
View Full Code Here

            rendImage = new BufferedImage(image.getWidth(null), image.getHeight(null), 1);
            Graphics g = rendImage.createGraphics();
            g.drawImage(image, 0, 0, null);
        }
        writer.write(new IIOImage(rendImage, null, null));
        writer.dispose();
    } // saveImage

    /**
     * Loads an Image.
     *
 
View Full Code Here

            "Could not find javax.imageio.ImageWriter for Content-Type [" + contentType + "]");
      }
    }
    finally {
      if (imageWriter != null) {
        imageWriter.dispose();
      }
      if (imageOutputStream != null) {
        try {
          imageOutputStream.close();
        }
View Full Code Here

    iwp.setCompressionQuality(_quality);
    ImageOutputStream ios = ImageIO.createImageOutputStream(os);
    iw.setOutput(ios);
    iw.write(null, new IIOImage(image, null, null), iwp);
    ios.flush();
    iw.dispose();
    ios.close();
    return os.toByteArray();
  }
  /** Returns the quality of the image encoding.
   * It is a number between 0 and 1. The higher the value,
View Full Code Here

                iwparam.setCompressionQuality(jpegQuality);//Set here your compression rate
                ImageWriter iw = ImageIO.getImageWritersByFormatName("jpg").next();
                ImageOutputStream ios = ImageIO.createImageOutputStream(baos);
                iw.setOutput(ios);
                iw.write(null, new IIOImage(scaled, null, null), iwparam);
                iw.dispose();
                ios.close();

                scaled.flush();
                scaled = null;
                image = com.itextpdf.text.Image.getInstance(baos.toByteArray());
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.