Android的力量相机拍摄的照片以横向模式 [英] android force camera to take photo in landscape mode

查看:180
本文介绍了Android的力量相机拍摄的照片以横向模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要强制默认的Andr​​oid相机拍摄的照片只在横向模式。 我曾尝试以下操作:

I want to force the default android camera to take photo in landscape mode only. I have tried following:

         Intent cameraIntent=new Intent("android.media.action.IMAGE_CAPTURE");
         File photo = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "Pic.jpg");
         cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
         cameraIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
         startActivity(cameraIntent);

但这仅适用于2.1不是以后。 我只是想有照片图像保存在横向模式。我不希望使用的任何图像处理,如矩阵或自相机

but this works only in 2.1 not for later. I just want to have photo image to be saved in landscape mode. I don't want to use any image processing such as matrix or custom camera.

注:我是这个意图从具有定向固定的活动人像

Note: I am calling this intent from the activity which has the orientation fixed as "portrait"

推荐答案

在AndroidManifest.xml中

In androidmanifest.xml

<activity android:name="activity_name" android:screenOrientation="landscape" />

此活动将您的图像拍摄活动。

This activity will be your image capturing activity.

这篇关于Android的力量相机拍摄的照片以横向模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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