Android的人像镜头的可靠性 [英] Android portrait camera reliability

查看:164
本文介绍了Android的人像镜头的可靠性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发和应用有针对性的SDK 8分钟SDK 7使用摄影机视图。

I'm developing and app targeted SDK 8 with min SDK 7 that uses a camera view.

显然是有这个问题旋转的已讨论了相当数量的已相机的肖像。目前,我有以下修补程序分开SDK 7和8 +:

Obviously there is this issue of rotating the Camera for portrait that has had a fair amount of discussion already. I currently have the following fix that separates SDK 7 and 8+:

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO){
    theCamera.setDisplayOrientation(90);
} else {
    parameters.set("orientation", "portrait");
    parameters.set("rotation",90);
}

这既是一个2.1update1设备和SGS2我已经(运行ICS)的作品。

Which works on both a 2.1update1 device and a SGS2 i have (running ICS).

我的问题是,什么样的可靠性得到这些解决方案跨设备?我已经看到了一些解决方案,以pre-升级Froyo的局面,因此即时通讯怀疑这个解决方案工作的所有设备。我也想知道如何'setdisplayorientation尊重在不同的设备...

My question is, what kind of reliability do these solutions have across devices? I've seen a few solutions to the 'pre-froyo' situation, so im dubious of this solution working for all devices. I'm also wondering how well 'setdisplayorientation' is respected on different devices...

我会非常感激听到这个方面的经验。

I'd be really grateful to hear of other's experience with this.

所以一些更多的信息:如何正确设置Android摄像头的方向 这说明,这些方法的工作的一些时间。从什么角度(SDK版本)那么进一步的问题没有setDisplayOrientation开始工作,所有的时间?

So some more info: How to set Android camera orientation properly? This explains that these methods work some of the time. So further question from what point (SDK version) did setDisplayOrientation start working ALL of the time??

推荐答案

一种怪异的解决方案,方向不会完全适用于所有的设备。它完全依赖于硬件,可以改变设备到设备(我已经尝试了很多的设备)。你不能修复它简单,只有一个选择,你刚才允许用户设置轮换一次,你的应用程序,在第一时间推出让用户设置好的底座旋转角度,并保存在一次做,你可以做任何你的设置要算账。

One weird solution, orientation will not be exactly same for all the devices. It is completely hardware dependent, can vary device to device(I have tried on many devices). You can't fix it simply, only one option you have just allow user to set the rotation once your application launched at first time get the base rotation angle setted by the user and save it in to the settings once done you can do whatever you want afterwards.

这篇关于Android的人像镜头的可靠性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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