Java – stack multiple bufferedimages together?

I have multiple transparent buffered image instances. I want to stack them together (that is, Photoshop layers) and bake them into a buffered image output What should I do?

Solution

I want to say that the best option is to get the buffered image and create an additional image so that an object can be attached to it Then just use graphics DrawImage () places them on top of each other

So along these directions:

BufferedImage a = ImageIO.read(new File(filePath,"a.png"));
BufferedImage b = ImageIO.read(new File(filePath,"b.png"));
BufferedImage c = new BufferedImage(a.getWidth(),a.getHeight(),BufferedImage.TYPE_INT_ARGB);

Graphics g = c.getGraphics();
g.drawImage(a,null);
g.drawImage(b,null);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>