开发者

Changing the size of a SurfaceView

开发者 https://www.devze.com 2023-04-11 22:59 出处:网络
I am trying to use only a small portion of th开发者_开发百科e screen to display the view from the camera.

I am trying to use only a small portion of th开发者_开发百科e screen to display the view from the camera.

Here is my XML file.

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/backimage" android:orientation="horizontal">

<android.view.SurfaceView android:id="@+id/preview"
  android:layout_width="fill_parent" android:layout_height="100dp"/>
</LinearLayout>

This code runs on my phone, however, I do not see anything from the camera.

I do see the input from the camera when I use this XML

<android.view.SurfaceView android:id="@+id/preview"
  android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</LinearLayout>

Should I use another type of object to display a smaller view of the camera ?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号