Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 光摄像机。方位总是90度?_C#_Windows Phone 8_Windows Runtime_Windows Phone - Fatal编程技术网

C# 光摄像机。方位总是90度?

C# 光摄像机。方位总是90度?,c#,windows-phone-8,windows-runtime,windows-phone,C#,Windows Phone 8,Windows Runtime,Windows Phone,为什么PhotoCamera类的方向属性总是90,而不管我是从横向切换到纵向,还是从横向切换到纵向 文档将此属性描述为: 获取取景器笔刷需要顺时针旋转以与相机传感器对齐的度数 如果是这种情况,当我在LandscapeLeft模式下握住相机时,方向属性不应该是0吗 我错过了什么 [复制此信息的示例步骤] 从这个链接下载示例代码 在MainPage.xaml集合中 SupportedOrientations=“肖像或风景” 在MainPage.xaml.cs中,修改OnOrientationChan

为什么PhotoCamera类的方向属性总是90,而不管我是从横向切换到纵向,还是从横向切换到纵向

文档将此属性描述为:

获取取景器笔刷需要顺时针旋转以与相机传感器对齐的度数

如果是这种情况,当我在LandscapeLeft模式下握住相机时,方向属性不应该是0吗

我错过了什么

[复制此信息的示例步骤]

从这个链接下载示例代码

在MainPage.xaml集合中 SupportedOrientations=“肖像或风景”

在MainPage.xaml.cs中,修改OnOrientationChanged方法以打印Camera.Orientation

protected override void OnOrientationChanged(OrientationChangedEventArgs e)
    {
        if (cam != null)
        {
            System.Diagnostics.Debug.WriteLine(cam.Orientation.ToString());

你使用的设备有陀螺仪吗?如果不是,则无法测量方向。是。我正在使用诺基亚Lumia 820。@科林,如果设备没有陀螺仪,加速计不能提供方向吗?