Share via


OrientationSensor.GetDeviceSelector 方法

定义

重载

GetDeviceSelector(SensorReadingType)

获取设备选择器。

GetDeviceSelector(SensorReadingType, SensorOptimizationGoal)

获取设备选择器。

GetDeviceSelector(SensorReadingType)

获取设备选择器。

public:
 static Platform::String ^ GetDeviceSelector(SensorReadingType readingType);
/// [Windows.Foundation.Metadata.Overload("GetDeviceSelector")]
 static winrt::hstring GetDeviceSelector(SensorReadingType const& readingType);
[Windows.Foundation.Metadata.Overload("GetDeviceSelector")]
public static string GetDeviceSelector(SensorReadingType readingType);
function getDeviceSelector(readingType)
Public Shared Function GetDeviceSelector (readingType As SensorReadingType) As String

参数

readingType
SensorReadingType

要检索的传感器的类型。

返回

String

Platform::String

winrt::hstring

返回设备选择器(如果存在);否则为 null。

属性

Windows 要求

设备系列
Windows 10 Fall Creators Update (在 10.0.16299.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v5.0 中引入)

适用于

GetDeviceSelector(SensorReadingType, SensorOptimizationGoal)

获取设备选择器。

public:
 static Platform::String ^ GetDeviceSelector(SensorReadingType readingType, SensorOptimizationGoal optimizationGoal);
/// [Windows.Foundation.Metadata.Overload("GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal")]
 static winrt::hstring GetDeviceSelector(SensorReadingType const& readingType, SensorOptimizationGoal const& optimizationGoal);
[Windows.Foundation.Metadata.Overload("GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal")]
public static string GetDeviceSelector(SensorReadingType readingType, SensorOptimizationGoal optimizationGoal);
function getDeviceSelector(readingType, optimizationGoal)
Public Shared Function GetDeviceSelector (readingType As SensorReadingType, optimizationGoal As SensorOptimizationGoal) As String

参数

readingType
SensorReadingType

要检索的传感器的类型。 Absolute SensorReadingType 使用加速计、陀螺仪和磁力计返回 OrientationSensor,以确定相对于磁北的方向。 相对 SensorReadingType 使用加速计和陀螺测试仪返回 OrientationSensor, (没有磁力计) ,相对于传感器首次实例化的位置进行测量。

optimizationGoal
SensorOptimizationGoal

指示传感器的优化首选项。 仅当指定了 Absolute SensorReadingType 时,才使用此字段。 Precision 的 optimizationGoal 将使用加速度计、陀螺仪和磁力计返回 OrientationSensor,以确定相对于磁北的方向。 由于它使用的是陀螺测试仪,因此有可能使用大量的功率。 相比之下,指定 PowerEfficiency 的 optimizationGoal 将返回使用加速计和磁力计(仅 (无陀螺测试仪) )的 OrientationSensor,但代价是某些精度 (读数在大多数情况下仍相对准确) 。

返回

String

Platform::String

winrt::hstring

返回设备选择器(如果存在);否则为 null。

属性

Windows 要求

设备系列
Windows 10 Fall Creators Update (在 10.0.16299.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v5.0 中引入)

适用于