HTC的Android手机有两个后置摄像头 [英] Android HTC phone with two rear cameras
问题描述
我想在HTC手机选择后置摄像头,但在API中我只有两个摄像头:<一href=\"http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#CAMERA_FACING_FRONT\"相对=nofollow> CAMERA_FACING_FRONT ,<一个href=\"http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#CAMERA_FACING_BACK\"相对=nofollow> CAMERA_FACING_BACK 。当我打电话的open()与<一个href=\"http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#CAMERA_FACING_BACK\"相对=nofollow> CAMERA_FACING_BACK ,我得到我不希望摄像头(其中一个比另一个较低分辨率)。
I'm trying to select the rear camera in HTC phones but in the API I have only two cameras: CAMERA_FACING_FRONT, CAMERA_FACING_BACK. When I call the open() with CAMERA_FACING_BACK, I get the camera that I don't want (lower resolution than the other one).
我应该使用哪个ID来打开其他后置摄像头?
Which id should I use to open the other rear camera?
推荐答案
您不能直接选择相机。
您应该打开与相机<一个href=\"http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#CAMERA_FACING_FRONT\"相对=nofollow> CAMERA_FACING_BACK 和<一个href=\"http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setPictureSize%28int%2C%20int%29\"相对=nofollow>设置图片大小(它有27个可能不同的尺寸!)。
You should open the camera with CAMERA_FACING_BACK and set a picture size (it has 27 possible different sizes!).
因此与您设置为软件摄像机图像尺寸,硬件相机之一将被选中的人。
Accordingly with picture size you set to the software camera, one of hardware cameras will be the chosen one.
这篇关于HTC的Android手机有两个后置摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!