Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.constraint.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".RecordVideo">
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:id="@+id/camview"
- android:layout_height="fill_parent">
- <FrameLayout
- android:id="@+id/camera_preview"
- android:adjustViewBounds="true"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <SurfaceView
- android:id="@+id/sview"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true" />
- <ImageView
- android:id="@+id/ImgLogo1"
- android:layout_width="80dp"
- android:src="@drawable/rotating_earth"
- android:layout_alignParentLeft="true"
- android:layout_height="80dp" />
- <ImageView
- android:id="@+id/ImgLogo2"
- android:layout_width="80dp"
- android:src="@mipmap/ic_launcher"
- android:layout_alignParentRight="true"
- android:layout_height="80dp" />
- <ImageButton
- android:id="@+id/button_capture"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:background="?android:attr/selectableItemBackground"
- android:src="@mipmap/img_record_green"
- android:layout_gravity="center" />
- </RelativeLayout>
- Display display = getWindowManager().getDefaultDisplay();
- Point size = new Point();
- display.getSize(size);
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inSampleSize = 1;
- Bitmap bMap = BitmapFactory.decodeFile(tmpFile.toString(), options);
- Bitmap BbMap = Bitmap.createScaledBitmap(bMap, size.x, size.y,true);
- preview = (FrameLayout) findViewById(R.id.camera_preview);
- preview.setBackground(new BitmapDrawable(BbMap));
Add Comment
Please, Sign In to add comment