package org.yl.rpa;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
public class Image {
public static boolean merge(String[] imgs, String type, String mergePic) {
int dstHeight = 0;
int dstWidth = 0;
// 获取需要拼接的图片长度
int len = imgs.length;
// 判断长度是否大于0
if (len < 1) {
return false;
}
File[] file = new File[len];
BufferedImage[] images = new BufferedImage[len];
int[][] ImageArrays = new int[len][];
for (int i = 0; i < len; i++) {
try {
file[i] = new File(imgs[i]);
images[i] = ImageIO.read(file[i]);
} catch (Exception e) {
e.printStackTrace();
return false;
}
int width &
java程序将多张图片合成一张
最新推荐文章于 2025-02-10 08:00:00 发布