相机和相框Android

时间:2012-09-21 07:15:51

标签: android camera surfaceview

我是android编程的新手,我想学习使用相机制作简单的应用程序并将其保存在SD卡中,但在相机中有框架布局,所以当我用相机拍摄时,在我的SD卡中也会显示带框架的图片。我已经搜索了带有曲面的相机并保存到SD卡中,但是帧中没有得到的问题保存在那张图片中......任何人都可以帮我教程吗?

1 个答案:

答案 0 :(得分:0)

执行此操作的简单方法是拍摄包含图像和框架的布局。快照返回您可以保存的位图。
以下是如何实现这一目标:

//here root layout is the layout containing the frame and the image
rootLayout.setDrawingCacheEnabled(true);
// bitmap containing frame and image
Bitmap snapBmp = root.getDrawingCache();

// now you can save this bitmap
... 
...