android - How can I extract a portion of a camera? -
android - How can I extract a portion of a camera? -
i'm using photographic camera in android tutorial in "insert frame photo" app http://developer.android.com/guide/topics/media/camera.html have imageview in framelayout insert image frame, within part transparent.
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <framelayout android:id="@+id/camera_container" android:layout_width="fill_parent" android:layout_height="match_parent" android:gravity="top" android:orientation="vertical" > </framelayout> <imageview android:id="@+id/grid" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/demo" /> </relativelayout> </linearlayout>
how can extract frame image within part camera?
private static final int capture_image_activity_request_code = 100; private static final int capture_video_activity_request_code = 200; @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == capture_image_activity_request_code) { if (resultcode == result_ok) { // image captured , saved fileuri specified in intent toast.maketext(this, "image saved to:\n" + data.getdata(), toast.length_long).show(); } else if (resultcode == result_canceled) { // user cancelled image capture } else { // image capture failed, advise user } } if (requestcode == capture_video_activity_request_code) { if (resultcode == result_ok) { // video captured , saved fileuri specified in intent toast.maketext(this, "video saved to:\n" + data.getdata(), toast.length_long).show(); } else if (resultcode == result_canceled) { // user cancelled video capture } else { // video capture failed, advise user } } }
android camera imageview framelayout
Comments
Post a Comment