LampArray.FromIdAsync(String) 方法

定義

擷取 LampArray 裝置的 LampArray 物件,該裝置具有指定的隨插即用 (PnP) 裝置識別碼/裝置實例路徑。

public:
 static IAsyncOperation<LampArray ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<LampArray> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<LampArray> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of LampArray)

參數

deviceId
String

Platform::String

winrt::hstring

裝置的裝置識別碼/裝置實例路徑。 若要取得值,請取得從DeviceWatcher擷取的 DeviceInformation.Id屬性值

傳回

IAsyncOperation(LampArray) 回物件,傳回作業的結果。

使用 DeviceWatcher 來判斷裝置識別碼。

屬性

範例

LampArray 範例

示範如何使用Windows.Devices.Lights 和 Windows.Devices.Lights.Effects API 來控制周邊裝置的 RGB 光源。

AutoRGB 範例

示範如何從桌面畫面擷取單一代表性色彩,並用它來在連接的 RGB 裝置上亮起 LED 燈。

適用於

另請參閱