我尝试使用本机摄像头在实时视频上实现图像叠加。代码如下:
if (bmp != null)
{
Canvas canvas = mHolder.lockCanvas();
if (canvas != null)
{
canvas.drawBitmap(bmp, (canvas.getWidth() - bmp.getWidth()) / 2,(canvas.getHeight() - bmp.getHeight()) / 2, null);
canvas.drawBitmap(drawable,0,0, null);
mFps.draw(canvas, (canvas.getWidth() - bmp.getWidth()) / 2, 0);
mHolder.unlockCanvasAndPost(canvas);
}
bmp.recycle();
}
但是当我运行程序时,它说强制关闭。我使用的图像尺寸是 751 x 500。请问有什么建议吗?(或任何替代方法?)
提前感谢您的输入。