我们通过java把下面的背景图和二维码以及一段文字合并成一张新的图片
背景图片:
二维码图片:
public class Main {
/**
* 合成图片
*
* @param backgroundPath
* @param qrCodePath
* @param message
* @param outPutPath
* @throws IOException
*/
public static void overlapImage(String backgroundPath, String qrCodePath, String message, String outPutPath) throws IOException {
// 设置背景图片大小
BufferedImage backgroundImage = resizeImage(566, 230, ImageIO.read(new File(backgroundPath)));
// 设置二维码图片大小
BufferedImage qrCodeImage = resizeImage(150, 150, ImageIO.read(new File(qrCodePath)));
Graph