Android摄像头纵向纵向、摄像头、Android

2023-09-13 00:01:46 作者:清酒话桑麻

我使用的摄像头在我的应用程序。我只是用意图来启动相机

I am using camera in my app. I am just using intent to start camera

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
        startActivityForResult(cameraIntent, 101);

所拍摄的图像自动出现在横向视图。如何让我的相机来捕捉纵向视图图像

The captured image automatically comes in landscape view. How do i make camera to capture images in portrait view

推荐答案

如果设备有 2.2 或以上,你可以使用 camera.setDisplayOrientation(90)。在到V2.2相机将只在显示横向,因此图像会在景观以下的设备。检查这些职位纵向使用相机,Camera是错误的,除非键盘打开。

If device has v2.2 or above you can rotate camera orientation to portrait using camera.setDisplayOrientation(90). In devices below to v2.2 the camera will only display in landscape orientation and thus image will come in landscape. Check these posts Using Camera in Portrait Orientation, Camera is wrong unless keyboard is open.

 
精彩推荐
图片推荐