ImageCompress

 

//	private  static BufferedImage createZoomSizeImage (Image image,Component comp,int width,int height)   { 
//	    BufferedImage bimg = null; 
//	    AreaAveragingScaleFilter filter = new AreaAveragingScaleFilter(width,height); 
//	    FilteredImageSource producer   = new FilteredImageSource(image.getSource(),filter); 
//	    bimg = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR); 
//	    Graphics   graphics = bimg.createGraphics(); 
//	    graphics.drawImage(comp.createImage(producer),0,0,null); 
//	    
//	    return   bimg; 
//		}



///////////////////////GIF支持
  BufferedImage img = ImageIO.read(photoFile);
            BufferedImage newImage = new BufferedImage(80, 80, BufferedImage.TYPE_INT_RGB);
            newImage.getGraphics().drawImage(img,0,0,img.getWidth(null),img.getHeight(null),null);
            String iconNewName = strPhotoPath+"ico_"+strPhotoFileName;
            OutputStream out=new FileOutputStream(new File(iconNewName));//
            JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(out);
            encoder.encode(newImage);
            out.close();

http://hi.baidu.com/zim_it/blog/item/f352c51d39b9aa1240341730.html

http://k.techq.com/a/java/20110112/28367.html
http://www.exampledepot.com/egs/javax.imageio/Graphic2File.html

http://www.exampledepot.com/egs/javax.imageio/JpegWrite.html
http://hi.baidu.com/pep525/blog/item/7d068e3b9aa900ef15cecba4.html

http://phoenix007.iteye.com/blog/263441
http://llade.iteye.com/blog/648492
http://caiceclb.iteye.com/blog/627219

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值