没有合适的资源?快使用搜索试试~ 我知道了~
关于java处理图形文件的资料 ,解决的是图像的显示等
资源推荐
资源详情
资源评论










package com.xxx.utility;
/** *//*******************************************************************************
* <p>Title: xxx </p>
* <p>Description: xxx </p>
* <p>Copyright: Copyright (c) 2006 DavidHsing All Rights Reserved </p>
* <p>Company: xxx </p>
* <p>WebSite: http://blog.csdn.net/DavidHsing </p>
*
* @author : DavidHsing <DavidHsing(At)163.com>
* @version : 1.00
* @date : 2006-11-30
* @direction: 图像格式转换类(转换时不需要关心源图的格式)
* @support : GIF(no compressed encoding), JPEG, TIFF, PNG, PICT, BMP, Targa, ICO, CUR, XBM, XPM, PCX, DCX
******************************************************************************/
import com.sun.jimi.core.*;
import com.sun.jimi.core.options.*;
import java.awt.image.*;
import java.io.*;
//******************************************************************************
public class JimiImage
...{
//public JimiImage() {}
//==========================================================================
/** *//*******************************************************************************
* <p>Title: xxx </p>
* <p>Description: xxx </p>
* <p>Copyright: Copyright (c) 2006 DavidHsing All Rights Reserved </p>
* <p>Company: xxx </p>
* <p>WebSite: http://blog.csdn.net/DavidHsing </p>
*
* @author : DavidHsing <DavidHsing(At)163.com>
* @version : 1.00
* @date : 2006-11-30
* @direction: 图像格式转换类(转换时不需要关心源图的格式)
* @support : GIF(no compressed encoding), JPEG, TIFF, PNG, PICT, BMP, Targa, ICO, CUR, XBM, XPM, PCX, DCX
******************************************************************************/
import com.sun.jimi.core.*;
import com.sun.jimi.core.options.*;
import java.awt.image.*;
import java.io.*;
//******************************************************************************
public class JimiImage
...{
//public JimiImage() {}
//==========================================================================
/** *//**
* 转换图像格式为 JPG
* @param String : sSourceImage, 其它格式的源图像文件路径
* @param String : sDestImage, 目标 JPG 图像文件存放路径
* @param int : nQuality, 品质, 0-100, 数值越高品质越好
* @return boolean
*/
public boolean convertToJPG(String sSourceImage, String sDestImage, int nQuality)
...{
if (sSourceImage == null || sSourceImage.trim().equals(""))
...{
System.out.println(" @> JimiImage.convertToJPG() : 要转换的源图像文件路径不能为空!");
return false;
}
if (sDestImage == null || sDestImage.trim().equals(""))
...{
sDestImage = sSourceImage.substring(0, sSourceImage.lastIndexOf(".")) + ".jpg";
}
else if (!sDestImage.endsWith(".jpg"))
...{
sDestImage += ".jpg";
}
//----------------------------------------------------------------------
//检查源图像文件
File tSourceImageFile = new File(sSourceImage);
if (!tSourceImageFile.exists())
...{
* 转换图像格式为 JPG
* @param String : sSourceImage, 其它格式的源图像文件路径
* @param String : sDestImage, 目标 JPG 图像文件存放路径
* @param int : nQuality, 品质, 0-100, 数值越高品质越好
* @return boolean
*/
public boolean convertToJPG(String sSourceImage, String sDestImage, int nQuality)
...{
if (sSourceImage == null || sSourceImage.trim().equals(""))
...{
System.out.println(" @> JimiImage.convertToJPG() : 要转换的源图像文件路径不能为空!");
return false;
}
if (sDestImage == null || sDestImage.trim().equals(""))
...{
sDestImage = sSourceImage.substring(0, sSourceImage.lastIndexOf(".")) + ".jpg";
}
else if (!sDestImage.endsWith(".jpg"))
...{
sDestImage += ".jpg";
}
//----------------------------------------------------------------------
//检查源图像文件
File tSourceImageFile = new File(sSourceImage);
if (!tSourceImageFile.exists())
...{
资源评论

yuzhisheng1986
- 粉丝: 0
- 资源: 1

上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
已下载
下载帮助

资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
