0

我有一个应用程序可以使用照片叠加拍摄照片然后调整大小,这是我的代码,是否可以为相机设置大小以避免拍照后调整大小的过程,因为拍照后我有一些延迟..

View_Camera_Overlay

<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/viewSwitcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".CameraCapture"
android:measureAllChildren="false" >

<include
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_gravity="fill"
   layout="@layout/view_camera_overlay" />

<include
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   layout="@layout/view_show_book_detection" />

</ViewSwitcher>

相机叠加层

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

 <SurfaceView
    android:id="@+id/cameraView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

 <ImageView
    android:id="@+id/cameraOverlay"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:src="@drawable/book" />

 <Button
    android:id="@+id/buttonCapture"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center_horizontal"
    android:text="@string/camera_capture" />

</FrameLayout>

相机活动

http://pastebin.com/p8DfTKEu

你能在这个实施中帮助我吗

提前致谢

4

1 回答 1

0

你有没有在 Camera.Parameters 中检查SetPictureSize还要确保相机支持图片大小。您可以为此使用getSupportedPictureSizes

于 2013-09-06T01:20:19.763 回答