English 中文(简体)
恢复照相机预科
原标题:Resizing the Camera Preview
  • 时间:2011-03-31 11:42:12
  •  标签:
  • android

我实施了摄像机,将显示该装置整个屏幕上的预测。 但是,我的要求是在小屏幕上显示摄像机预览。 我的装置是800x480(WxH),即Nexus。 我能够在整个屏幕上展示预览,而不缩小预审。 其一成不变,但当我尝试在小屏幕上展示预约时(作为我全部移动屏幕的一部分),预审就会变得紧张,而不是看好。

在小型屏幕上正确显示预约是否有任何办法。 我认为,我们需要缩小形象审查的规模。 但是,在试图缩小图像审查规模时, and系统本身却不允许确定规模较大的审查规模。

请允许我帮助我如何在小屏幕上扩大图像审查。

问题回答

在大约一个星期内与同一问题作斗争之后,我终于获得了照相机的预览,以便从方案上转播自己! D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D. D.

<代码>preview>/代码>是我的<代码>SurfaceView的名称,在本法典中,我已设立这一编号,以便将其重新定位为<编码>RelativeLayout的一半。

ViewGroup.LayoutParams params = preview.getLayoutParams();
RelativeLayout myRelLayout = (RelativeLayout) findViewById(R.id.myRelLayout);
params.width = (int) (myRelLayout.getWidth()/2);
preview.setLayoutParams(params);

现在供你使用,你需要研究审查的解决,然后根据该决议缩小审查的高度或宽度。

每天,

你们是否试图改变

<android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/preview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/ButtonGroup"
        />

......

<android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/preview"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_above="@id/ButtonGroup"
        />

如果这并非你所回顾的话,你也许会把现行法典放在后面,这样我们就可以看它吗?





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签