把二个图片合并起来,就是叠在一起,成为一个图片,有好办法吗?谢谢 把二个图片合并起来,就是叠在一起,成为一个图片,有好办法吗?谢谢分不多,绝对给分。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // 两图片合成,自己设定合成位置 public static void jpegSynthesis(File srcfile1, File srcfile2, int picw, int pich, int s1x, int s1y, int s1width, int s1height, int s2x, int s2y, int s2width, int s2height, String name) throws IOException { System.out.println(srcfile1); Image src1 = javax.imageio.ImageIO.read(srcfile1); Image src2 = javax.imageio.ImageIO.read(srcfile2); BufferedImage tag = new BufferedImage(picw, pich, BufferedImage.TYPE_INT_RGB); // tag.getGraphics().drawImage(,0,0,picw,pich,Color.WHITE,null); tag.getGraphics().drawImage(src1, s1x, s1y, s1width, s1height, null); tag.getGraphics().drawImage(src2, s2x, s2y, s2width, s2height, null); FileOutputStream out = new FileOutputStream(name); // 输出到文件流 JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); encoder.encode(tag); System.out.println("两副图片合成完毕!" + picw + "*" + pich); out.close(); } 这个处理JPG可以,但处理GIF不行,处理Gif时,输出的图像都变了。 关于java导出excel问题 请大家帮我分析下这段代码 JAVA 连接数据库问题 请高手指点 无法实现多线程 一些基本概念问题 我想把菜单可以拖动,就象office的菜单那样,要怎么做呀,谢谢 assertion wrapper 是什么?帮忙解释一下。为什么在docs里面查不到?! 开发java下的数据库程序,用什么数据库引擎? JAVA算法研究书 java+corba+applet Swing 里JTable 可以插入图片吗??怎么查?????/ 如果List a=new ArrayList(),那么a!=null?
public static void jpegSynthesis(File srcfile1, File srcfile2, int picw,
int pich, int s1x, int s1y, int s1width, int s1height, int s2x,
int s2y, int s2width, int s2height, String name) throws IOException {
System.out.println(srcfile1);
Image src1 = javax.imageio.ImageIO.read(srcfile1);
Image src2 = javax.imageio.ImageIO.read(srcfile2);
BufferedImage tag = new BufferedImage(picw, pich,
BufferedImage.TYPE_INT_RGB);
// tag.getGraphics().drawImage(,0,0,picw,pich,Color.WHITE,null);
tag.getGraphics().drawImage(src1, s1x, s1y, s1width, s1height, null);
tag.getGraphics().drawImage(src2, s2x, s2y, s2width, s2height, null);
FileOutputStream out = new FileOutputStream(name); // 输出到文件流
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(tag);
System.out.println("两副图片合成完毕!" + picw + "*" + pich);
out.close();
}