0

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

4

1 回答 1

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
... 
...
于 2012-09-21T08:54:58.393 回答