Magnetometer class
TOC
Collapse the table of content
Expand the table of content

Magnetometer class

[ Updated for UWP apps on Windows 10. For Windows 8.x articles, see the archive ]

Represents a magnetic sensor.

Syntax


public sealed class Magnetometer

Members

The Magnetometer class has these types of members:

Events

The Magnetometer class has these events.

EventDescription
ReadingChanged Occurs each time the compass reports a new sensor reading.

 

Methods

The Magnetometer class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetCurrentReading Gets the current magnetometer reading.
GetDefault Returns the default magnetometer.

 

Properties

The Magnetometer class has these properties.

PropertyAccess typeDescription

DeviceId

Read-onlyGets the device identifier.

MinimumReportInterval

Read-onlyGets the minimum report interval supported by the magnetometer.

ReadingTransform

Read/writeGets or sets the transformation that needs to be applied to sensor data. Transformations to be applied are tied to the display orientation with which to align the sensor data.

ReportInterval

Read/writeGets or sets the current report interval for the magnetometer.

 

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Devices.Sensors
Windows::Devices::Sensors [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Sensors
Windows::Devices::Sensors [C++]

Metadata

Windows.winmd

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06030000)]

See also

Object

 

 

Show:
© 2016 Microsoft