有没有办法做到这一点?我遵循这个教程(http://marakana.com/forums/android/examples/39.html),它效果很好。另外,我将FrameLayout(包含相机预览)放入带有ImageView的RelativeLayout中。用相机捕捉图像并将图像放在该图像上,怎么样?
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<FrameLayout
android:id="@+id/preview"
android:layout_width="330dp"
android:layout_height="233dp"
android:layout_marginTop="22dp"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" >
</FrameLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image_on_preview" />
</RelativeLayout>
所以现在开始应用程序我有相机和imageview。如果我将照片保存到SD卡上,我只能得到用相机拍摄的照片,但不会出现图像视图(当然,为什么会出现)。现在我的问题如何保存呢? 为了更好地理解,我在使用我的应用程序时捕获了一个屏幕截图。
所以我想保存相机预览和ImageView的双方,以及在一个画面中。我不确定是否有可能,但如果我不必将图片保存到SD卡上,这将是最好的。我将在稍后添加一个“保存到SD卡”按钮来保存它。
**更新
现在我想出了一个办法。我将照片保存在SD卡上,然后当创建的文件变成另一个意图时。它包含两个图像浏览,即“image_on_preview”,另一个有我之前保存图片的来源。好了,现在我必须以某种方式得到棘手,二者结合起来imageviews :)
*** UPDATE2
好吧,我做到了。在第二个活动中,我将两个图像转换为位图。然后我画一个画布,它将它们放在彼此上,然后我可以直接将它保存到SD卡。