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,以判斷相對於磁北的方向。 Relative SensorReadingType 只會使用加速計和陀螺儀傳回 OrientationSensor (沒有磁力計) ,測量相對於感應器第一次具現化的位置。

optimizationGoal
SensorOptimizationGoal

指出感應器優化喜好設定。 只有在指定 Absolute SensorReadingType 時,才會使用此欄位。 Precision 的 optimizationGoal 會使用 accelereometer、陀螺儀和磁力計傳回 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 引進)

適用於