Title
public static Bitmap stitchImages(List<Bitmap> bitmaps) {
int width = 0, height = 0;
// 计算拼接后的图片大小
for (Bitmap bitmap : bitmaps) {
width += bitmap.getWidth();
height = Math.max(height, bitmap.getHeight());
}
// 创建拼接后的空白图片
Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(result);
// 拼接图片
int x = 0;
for (Bitmap bitmap : bitmaps) {
canvas.drawBitmap(bitmap, x, 0, null);
x += bitmap.getWidth();
}
return result;
}
2H
diyizhang
ewqewqewq
dierzhang
wewqewqewq
标签:bitmap,bitmaps,width,Bitmap,result,Test,height From: https://www.cnblogs.com/jooy/p/17309794.html