java如何实现加水印... 缩略图水印组件wsImage3.5 组件支持文字水印和图片水印,文字水印可设定透明度、阴影及阴影模糊,自定义字体、颜色、旋转角度等。图片水印也支持透明度。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上所说的可以给GIF图片打水印吗? jsp中如何实现 gif 水印??? jsp中如何实现 gif 水印??? jsp中如何实现 gif 水印??? Java可以真实实现对图片加水印,下面有http://www.programmerstudy.com/programme/java/20084/170.html http://www.programmerstudy.com/programme/java/20084/170.html 加水印前几天我才做了个。现在把代码发给你看看吧public final static void pressImage(String pressImg, String targetImg, int x, int y) { try { //目标文件 File file = new File(targetImg); Image src = ImageIO.read(file); int wideth = src.getWidth(null); int height = src.getHeight(null); BufferedImage image = new BufferedImage(wideth, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.createGraphics(); g.drawImage(src, 0, 0, wideth, height, null); //水印文件 File filebiao = new File(pressImg); //水印的缩放功能 Image src_biao = ImageIO.read(filebiao); //读取水印文件的宽度和高度 int wideth_biao = src_biao.getWidth(null); int height_biao = src_biao.getHeight(null); g.drawImage(src_biao, x, y, wideth_biao, height_biao, null); //水印文件结束 g.dispose(); FileOutputStream out = new FileOutputStream(targetImg); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); encoder.encode(image); out.close(); } catch (Exception e) { e.printStackTrace(); } } 下面是给图片加水印http://www.programmerstudy.com/programme/java/20084/170.html hibernate中一级缓存和二级缓存的具体区别是什么? 求一正则表达式 二维数组的问题 cmp 数据更新,删除问题 求助:关于Hibernate3创建Configuration对象的问题 如何显示clob内容 struts in action 中 register-complete的问题,希望各位帮助,在线等 求助!!关于xml问题,实在搞不懂!! help me ! 一个新手对JAVA名词的疑惑 关于用jboss3.2做实体bean 急:java上传图片加透明水印 有没有近期比较新的面试题?
http://www.programmerstudy.com/programme/java/20084/170.html
public final static void pressImage(String pressImg, String targetImg,
int x, int y) {
try {
//目标文件
File file = new File(targetImg);
Image src = ImageIO.read(file);
int wideth = src.getWidth(null);
int height = src.getHeight(null);
BufferedImage image = new BufferedImage(wideth, height,
BufferedImage.TYPE_INT_RGB);
Graphics g = image.createGraphics();
g.drawImage(src, 0, 0, wideth, height, null); //水印文件
File filebiao = new File(pressImg);
//水印的缩放功能
Image src_biao = ImageIO.read(filebiao);
//读取水印文件的宽度和高度
int wideth_biao = src_biao.getWidth(null);
int height_biao = src_biao.getHeight(null);
g.drawImage(src_biao, x, y, wideth_biao, height_biao, null);
//水印文件结束
g.dispose();
FileOutputStream out = new FileOutputStream(targetImg);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(image);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
http://www.programmerstudy.com/programme/java/20084/170.html