Java将图像合二为一

时间:2017-06-27 08:41:15

标签: java image bufferedimage

我有2个private void combainImages(List<String> imageList, String combainedImages) throws IOException { BufferedImage a = ImageIO.read(new File(imageList.get(0))); //imageList holds the path to all images BufferedImage b = ImageIO.read(new File(imageList.get(1))); BufferedImage c = new BufferedImage(a.getWidth(), a.getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics g = c.getGraphics(); g.drawImage(a, 0, 0, null); g.drawImage(b, 0, 0, null); ImageIO.write(c, "PNG", new File(combainedImages)); } ,我希望将其中一个放在另一个上面(图层类似),这是我的代码combine-buffered-images

combainedImages

结果是第二张图像是在不在下面的第一张图像上绘制的,因此location /app/ { proxy_http_version 1.1; proxy_pass http://app; } 与第二张图片相同。

感谢您的帮助。

0 个答案:

没有答案