有沒有辦法做到這一點?我遵循這個教程(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卡。