获取 iPhone 的相机分辨率? [英] Get iPhone's camera resolution?

查看:26
本文介绍了获取 iPhone 的相机分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以获取 iPhone 相机的分辨率吗?显然 3G 有 1200x1600,3GS 有 1500x2000,但是我如何从我的代码中获取这些值(不拍照).我需要他们对相机预览进行一些仿射变换.

Is there any way to get the resolution of the iPhone's camera? Apparently the 3G has 1200x1600, and 3GS has 1500x2000, but how do I obtain these values from inside my code (without taking the picture). I need them to make some affine transform to the camera preview.

我可以检测硬编码这些值是 3G 还是 3GS,但这只是最后的手段.

I could detect if it's 3G or 3GS to hardcode these values, but it's just the last resort.

推荐答案

我认为你的最后手段"是一个很好的解决方案.

I think your "last resort" is a good solution.

检测模型有什么问题?这两种型号的硬件都不会改变.您可能唯一担心的是 3GSX-R 或其他东西是否带有 16mpx 相机.到那时,您可能无论如何都必须更新您的应用,并且可以在列表中添加另一个值.

What's wrong with detecting the model? The hardware isn't going to change for either of those models.. The only concern you might have is if the 3GSX-R or something comes out with a 16mpx camera. At which point you'd probably have to update your app anyways and could just add another value to the list.

我投票支持模型检测.

这篇关于获取 iPhone 的相机分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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