0
我想把两个图像放在一起使用java。所以,我想在它的工作另一种缓冲图像的顶部绘制缓冲图像,但它破坏了图像的颜色最终图像是有点绿色 这里是我的代码:在另一个上绘制缓冲图像?
try
{
BufferedImage source = ImageIO.read(new File("marker.png"));
BufferedImage logo = ImageIO.read(new File("pic.png"));
Graphics2D g = (Graphics2D) source.getGraphics();
g.drawImage(logo, 20, 50, null);
File outputfile = new File("image.jpg");
ImageIO.write(source, "jpg", outputfile);
}
catch (Exception e)
{
e.printStackTrace();
}