摄像头旋转问题

来源:互联网 发布:女排五连冠 知乎 编辑:程序博客网 时间:2024/05/23 14:34
// 设置旋转角度
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
parameters.set("orientation", "portrait"); //
parameters.set("rotation", 90); // 镜头角度转90度(默认摄像头是横拍)
mCamera.setDisplayOrientation(90); // 在2.2以上可以使用
} else// 如果是横屏
{
parameters.set("orientation", "landscape"); //
mCamera.setDisplayOrientation(0); // 在2.2以上可以使用
}
http://stackoverflow.com/questions/5878042/android-camera-autofocus-on-demand