Package javax.imageio

Examples of javax.imageio.ImageWriter.dispose()


      try(final ImageOutputStream ios = ImageIO.createImageOutputStream(file)){
        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
        iwparam.setCompressionQuality(1f-dialogueBox.getCompressionRate()/100f);
        iw.setOutput(ios);
        iw.write(null, new IIOImage(rendImage, null, null), iwparam);
        iw.dispose();
        success = true;
      }
      }catch(final IOException e) { BadaboomCollector.INSTANCE.add(e); }
    rendImage.flush();
    return success;
View Full Code Here


      final ImageWriter iw      = ImageIO.getImageWritersByFormatName("bmp").next();//$NON-NLS-1$
      try(final ImageOutputStream ios  = ImageIO.createImageOutputStream(file)) {
        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
        iw.setOutput(ios);
        iw.write(null, new IIOImage(rendImage, null, null), iwparam);
        iw.dispose();
        success = true;
      }
      }catch(final IOException e) { BadaboomCollector.INSTANCE.add(e); }
    rendImage.flush();
    return success;
View Full Code Here

      try {
        try(final ImageOutputStream ios = ImageIO.createImageOutputStream(templateFile)){
          iw.setOutput(ios);
          iw.write(null, new IIOImage(bufferImage2, null, null), iwparam);
          iw.dispose();
        }
      }catch(final IOException ex) { BadaboomCollector.INSTANCE.add(ex); }

      graphic.dispose();
      graphic2.dispose();
View Full Code Here

      ImageWriter writer = (ImageWriter) iter.next();
      FileImageOutputStream fios = new FileImageOutputStream(new File(tmpFile));
      writer.setOutput(fios);
      writer.write(pBufferedImage);
      fios.close();
      writer.dispose();
    }
    return tmpFile;
  }

  //////////////////////////////////////////////////////////////////////////////
View Full Code Here

            //associated stream and image metadata and thumbnails to the output
            writer.write(null, new IIOImage(image, null, null), param);
            is.close();
            os.close();
            ios.close();
            writer.dispose();
        } catch (IOException ex) {
            io.getOut().println("Exception: " + ex.toString());
        }
    }
   
View Full Code Here

           
            BufferedImage bimg = convertToBufferedImage((Image)obj);
            ImageOutputStream out = ImageIO.createImageOutputStream(os);
            writer.setOutput(out);
            writer.write(bimg);
            writer.dispose();
            out.flush();
            out.close();
        } else {
            throw new IOException("Attachment type not spported " + obj.getClass());                   
        }
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();
    }

    /**
     * Load an Image.
     * @param in the stream to load the image
View Full Code Here

                    try {
                        BufferedImage bimg = convertToBufferedImage((Image) o);
                        ImageOutputStream out = ImageIO.createImageOutputStream(bos);
                        writer.setOutput(out);
                        writer.write(bimg);
                        writer.dispose();
                        out.flush();
                        out.close();
                        bos.close();
                    } catch (IOException e) {
                        throw new Fault(e);
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ImageOutputStream ios = ImageIO.createImageOutputStream(baos);
        imageWriter.setOutput(ios);
        imageWriter.write(new IIOImage((BufferedImage)image, null, null));
        ios.flush();
        imageWriter.dispose();
        return baos.toByteArray();
    }

    protected void updateAddress() {
        Echo echo = service.getPort(Echo.class);
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.