int android.graphics.bitmap.getheight'on a null object reference是怎么回
2个回答
推荐于2018-04-10
展开全部
private Bitmap mergeThumbnailBitmap(Bitmap firstBitmap, Bitmap secondBitmap) {
Bitmap bitmap = Bitmap.createBitmap(firstBitmap.getWidth(), firstBitmap
.getHeight(), firstBitmap.getConfig()); // 创建一个 512的图
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
canvas.drawBitmap(firstBitmap, 0,0, null); //第一张图,在大图的x坐标,用坐标,paint
canvas.drawBitmap(secondBitmap, firstBitmap.getWidth(), 0, null);
return bitmap;
}
Bitmap bitmap = Bitmap.createBitmap(firstBitmap.getWidth(), firstBitmap
.getHeight(), firstBitmap.getConfig()); // 创建一个 512的图
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
canvas.drawBitmap(firstBitmap, 0,0, null); //第一张图,在大图的x坐标,用坐标,paint
canvas.drawBitmap(secondBitmap, firstBitmap.getWidth(), 0, null);
return bitmap;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询