Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.84 KB

lightsensor.md

File metadata and controls

46 lines (29 loc) · 1.84 KB
-api-id -api-type
T:Windows.Devices.Sensors.LightSensor
winrt class

Windows.Devices.Sensors.LightSensor

-description

Represents an ambient-light sensor that provides the ambient-light reading as a LUX value.

-remarks

The following example demonstrates how a UWP app built with XAML and C# uses the GetDefault method to establish a connection to a light sensor. If no integrated light sensor is found, the method will return a null value.

[!code-csharpGetDefaultCS]

The following example demonstrates how a UWP app built with XAML registers a ReadingChanged event handler.

[!code-csharpEnableReadingChangedCS]

The following example shows the ReadingChanged event handler.

[!code-csharpReadingChangedCS]

Version history

Windows version SDK version Value added
1709 16299 FromIdAsync
1709 16299 GetDeviceSelector
1709 16299 MaxBatchSize
1709 16299 ReportLatency
2004 19041 ReportThreshold

-examples

For an example implementation, see the light sensor sample.

-see-also

LightSensor Sample, Light sensor sample (Windows 10)