安卓相机preVIEW旋转 [英] Android: Camera preview Rotated

查看:155
本文介绍了安卓相机preVIEW旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面对我的应用程序有问题,我使用这个相机preVIEW,但在相机preVIEW即使人站在垂直的看似站在水平......,看来我缺少我的preVIEW东西

i am facing a problem in my application, i am using this for the camera preview, but in the camera preview even the person standing vertically is appearing to stand horizontally... , it seems i am missing something in my preview

mSurfaceView = (SurfaceView)findViewById(R.id.surface);
    mSurfaceHolder = mSurfaceView.getHolder();
    mSurfaceHolder.addCallback(this);
    mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

plz帮助我,感谢名单

plz help me out , thanx

推荐答案

试试这个:的http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)

我不知道,如果你说,preVIEW不正确,或者如果preVIEW看起来很不错而且保存的图片是错误的。上面的链接应该可以解决preVIEW问题。

I'm not sure if you are saying that the preview is incorrect, or if the preview looks good and the saved picture is wrong. That link above should fix the preview problem.

如果保存的JPEG不正确的尝​​试:<一个href=\"http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation(int\" rel=\"nofollow\">http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation(int)

If the saved JPEG isn't right try this: http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation(int)

我只是复制并粘贴code的两个帅哥,它帮助了很多东西。

I just copied and pasted both hunks of code, it helped a lot.

这篇关于安卓相机preVIEW旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆