android - Full Background layer with transparent box in the center -


i creating app crop picture based on viewed in box overlay in center. there ways make outside box black, leaving center box transparent. have tried using margin in glsurfaceview, result need, make preview smaller.

this need

and doing right now.

these 2 similar images. if compare these 2 images, giving margin surfaceview make preview smaller.

this code surfaceview.

    <relativelayout      android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical" >      <android.opengl.glsurfaceview         android:id="@+id/surfaceview"         android:layout_width="match_parent"         android:layout_height="match_parent"        />  </relativelayout> 

this code overlay box

<relativelayout     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="match_parent"     >     <button         android:id="@+id/switchfilter"         android:layout_alignparentright="true"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_centerhorizontal="true"         android:text="filter"/>      <relativelayout         android:id="@+id/overlay"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:layout_centerinparent="true"         android:layout_margintop="150dp"         android:layout_marginleft="100dp"         android:layout_marginright="100dp"         android:layout_marginbottom="150dp"         android:background="@drawable/overlay_bg_green"/>      <button         android:id="@+id/takephoto"         android:layout_alignparentbottom="true"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_centerhorizontal="true"         android:text="take photo"/> </relativelayout> 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -