答えて

0

あなたは、ユーザーが自分の写真にフィットする輪郭を持たせたいと思っています。身体の輪郭とユーザーは、彼らが身体の輪郭に写っている人にフィットするようになります(うまくいけば、写真の被写体である人を襲うのではなく、カメラを動かしてください!)。

これが当てはまる場合、カメラプレビューの上にオーバーレイする画像ビューで輪郭線を描くことができます。

あなたのレイアウトxmlファイルでこれを定義することができます - 例えば:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/camera_frag" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <com.acme.vision.AutoFitTextureView 
     android:id="@+id/texture" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentTop="true" /> 

    <LinearLayout 
     android:id="@+id/control" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentTop="true" 
     android:background="@color/colorPrimaryTransparent" 
     android:orientation="vertical"> 

     <Button 
      android:id="@+id/picture_button" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:text="@string/picture_button_text" /> 

    </LinearLayout> 

    <RelativeLayout 
     android:id="@+id/tileview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentEnd="true" 
     android:layout_alignParentTop="true" 
     android:layout_toLeftOf="@+id/control" 
     android:background="@android:color/transparent" > 

     <ImageView 
      android:id="@+id/body_image" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/body_image_tablet" 
      android:layout_centerInParent="true" /> 

    </RelativeLayout> 

</RelativeLayout> 
関連する問題