Chinaunix首页 | 论坛 | 博客
  • 博客访问: 950458
  • 博文数量: 168
  • 博客积分: 3853
  • 博客等级: 中校
  • 技术积分: 1854
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-15 23:50
文章分类

全部博文(168)

文章存档

2014年(12)

2013年(46)

2012年(60)

2011年(11)

2010年(1)

2009年(17)

2008年(21)

我的朋友

分类: Java

2013-05-29 11:58:28

Jimi是Java的图像管理类库,主要提供的是Image IO的功能,其前身是Activated Intelligence。Jimi支持包括GIF, JPEG, TIFF, PNG, PICT, Photoshop, BMP, Targa, ICO, CUR, Sunraster, XBM, XPM, and PCX在内的各种格式图像。

 

官方地址:

 

最简单的方式:

package test;

import java.awt.Image;

import com.sun.jimi.core.Jimi;
import com.sun.jimi.core.JimiException;


public class ImageHelper {
 
 /**
  * 转换图片格式,基于jimi.jar
  * @param oldFile
  * @param newFile
  * @return
  */
 public static boolean convertImageFormat(String oldFile,String newFile)
 {
  boolean isok = true;
  try {
   Image img=Jimi.getImage(oldFile);
   Jimi.putImage(img,newFile);
  } catch (JimiException e) {
   isok = false;
   e.printStackTrace();
  }
  return isok;
 }
 
 
}

阅读(890) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~