Android Overlay ImageView在相机上

时间:2015-03-12 15:03:13

标签: android imageview overlay surface

我有一段打开相机预览并覆盖ImageView的代码。 我可以移动,调整大小并旋转它。 当我尝试拍摄位图相机和位图图像视图时,我无法看到我所看到的,实际上相机的背景是正确的,但是图像视图非常小,它位于左上角屏幕截图。

public void onPictureTake(byte[] data,Camera camera){

Bitmap bmp1=BitmapFactory.decodeByteArray(data,0,data.length);
Bitmap bmp1=((BitmapDrawable)image.getDrawable()).getBitmap();

bmp=Bitmap.createBitmap(bmp1.getWidth(),bmp1.getHeight(),Bitmap.Config.AR GB_888);
Canvas canvas=new Canvas(bmp);

canvas.drawBitmap(bmp1,new Matrix(),null);

canvas.drawBitmap(bmp2,image.getLeft(),image.getTop(),null);
Bitmap mutable=bmp.copy(Bitmap.Config.ARGB_888,true);

savePhoto(mutable);
}

0 个答案:

没有答案