page_type | languages | products | urlFragment | extendedZipContent | description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
LampArray |
|
Shows how to control RGB lighting of compatible peripheral devices. |
This sample shows how to control RGB lighting of peripheral devices using the Windows.Devices.Lights and Windows.Devices.Lights.Effects APIs.
Supported devices conform to the HID Lighting and Illumination Standard.
Specifically, this sample shows how to:
-
Use Windows.Devices.Enumeration.DeviceWatcher with an AQS filter to register for LampArray attach and removal events.
-
Obtain instances of Windows.Devices.Lights.LampArray and use them to query device properties and change RGB lighting colors and brightness.
-
Create compelling RGB lighting effects using the Windows.Devices.Lights.Effects APIs.
-
Create an app package with the "com.microsoft.windows.lighting" AppExtension. The sample will assume control of lighting when in the foreground. Declaring the "com.microsoft.windows.lighting" AppExtension will allow the sample to appear in the Dynamic Lighting page of Windows Settings, where it can be prioritized for lighting control when not in the foreground (supported on Windows build 23466 and above).
Note The Windows universal samples require Visual Studio to build and Windows 10 to execute.
To obtain information about Windows 10 development, go to the Windows Dev Center.
To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to Visual Studio.
Windows.Devices.Lights.Effects
Windows.Devices.Enumeration.DeviceWatcher
HID Lighting and Illumination Standard
Dynamic Lighting - This page also describes how to declare the "com.microsoft.windows.lighting" AppExtension for background (ambient) lighting control.
Dynamic lighting devices - This page contains a list of devices known to be compatible with the above HID Lighting standard.
Client: Windows 10, version 17763 or above.
Server: Not supported.
- If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
- Start Microsoft Visual Studio and select File > Open > Project/Solution.
- Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++ or C#). Double-click the Visual Studio Solution (.sln) file.
- Press Ctrl+Shift+B, or select Build > Build Solution.
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.
- Select Build > Deploy Solution.
- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.