Package javax.imageio

Examples of javax.imageio.ImageWriter.dispose()


                    writer.setOutput(ios);
                    this.write(wrapper, writer, quality, alpha);
                 } finally {
                    if (ios != null)
                        ios.close();
                    writer.dispose();
                }
            }
        }
    }
View Full Code Here


                writer.setOutput(ios);
                this.write(wrapper, writer, quality, alpha);
            } finally {
                if (ios != null)
                    ios.close();
                writer.dispose();
            }
        }
   }
}
View Full Code Here

              .getImageWritersByMIMEType(mimeType);
          if (itr.hasNext()) {
            ImageWriter w = itr.next();
                        w.setOutput(ImageIO.createImageOutputStream(output));
            w.write(convertToBufferedImage((Image)value));
            w.dispose();
          } else {
            // LOG no handler
          }
        }else if(DataHandler.class.isAssignableFrom(value.getClass())){
          ((DataHandler)value).writeTo(output);
View Full Code Here

            iwparam.setCompressionMode( ImageWriteParam.MODE_EXPLICIT ) ;
            iwparam.setCompressionQuality( ClientConnectionBean.imgQualityDefault );
            writer.write( null, new IIOImage(image, null, null), null );
           
            ios.flush();
            writer.dispose();
            ios.close();
         
          imageScreen.flush();
         
          byte[] payload = out.toByteArray();
View Full Code Here

            writer.setOutput( ios );
           
            writer.write( null, new IIOImage(image, null, null), null );
           
            ios.flush();
            writer.dispose();
            ios.close();
         
          imageScreen.flush();
         
          byte[] payload = out.toByteArray();
View Full Code Here

                        // this can reduce size, but can also break badly written decoders
                        iwpjpeg.setOptimizeHuffmanTables(true);
                    }
                    writer.setOutput(fios = new FileImageOutputStream(file));
                    writer.write(null, new IIOImage(bi, null, null), iwp);
                    writer.dispose();
                    flag = true;
                }
            }
            catch(IOException ex)
            {
View Full Code Here

                    ImageWriter writer = (ImageWriter)iter.next();
                    if (Main.m_settings.isDebug())
                        System.err.println(writer.getClass().getName());
                    writer.setOutput(fios = new FileImageOutputStream(file));
                    writer.write(new IIOImage(bi, null, null));
                    writer.dispose();
                    flag = true;
                }
            }
            catch(IOException ex)
            {
View Full Code Here

                            }
                            finally
                            {
                                if( imageWriter != null )
                                {
                                    imageWriter.dispose();
                                }
                            }
                        }
                        if( !foundWriter )
                        {
View Full Code Here

        ImageOutputStream ios = javax.imageio.ImageIO.createImageOutputStream(os);
        writer.setOutput(ios);

        writer.write(new IIOImage(image, null, null));
        ios.flush();
        writer.dispose();
    } // saveImage

}
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

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.