话不多说上源码
public
void WatermarkIcon(String src
, String imagedst
, String dst
, int x
, int y
, int w
, int h
) throws IOException
{
BufferedImage bis
= ImageIO
.read(new
File(src
));
BufferedImage bid
= ImageIO
.read(new
File(imagedst
));
Graphics2D g
= bis
.createGraphics();
g
.drawImage(bid
, 0, 0, 300, 200, 0, 0, bid
.getWidth(), bid
.getHeight(), null
);
ImageIO
.write(bis
, "jpg", new
FileOutputStream(dst
));
g
.dispose();
}
转载请注明原文地址: https://lol.8miu.com/read-23380.html