Android摄像头纵向 [英] android camera portrait orientation

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

问题描述

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

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 或以上,你可以使用<$ C $旋转摄像头方向为纵向C> camera.setDisplayOrientation(90)。在到V2.2相机将只在显示横向,因此图像会在景观以下的设备。检查这些职位纵向使用相机,<一个href="http://stackoverflow.com/questions/5504605/camera-is-wrong-unless-keyboard-is-open/5504651#5504651">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.

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

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