Torch​Control Torch​Control Torch​Control Class

Definition

Provides functionality for controlling the torch LED settings on a capture device.

public sealed class TorchControl : ITorchControlpublic sealed class TorchControl : ITorchControlPublic NotInheritable Class TorchControl Implements ITorchControl
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The TorchControl enables apps to manage the torch LED on a device. This can used in capture apps or in non-capture app to do things like brighten a room.

You can find out if a device supports this control by checking TorchControl.Supported.

You can access the TorchControl for the capture device through MediaCapture.VideoDeviceController.

For how-to guidance for using the TorchControl, see Camera-independent Flashlight.

Properties

Enabled Enabled Enabled

Gets or sets a value that enables and disables the torch LED on the device.

public PlatForm::Boolean Enabled { get; set; }public bool Enabled { get; set; }Public ReadWrite Property Enabled As bool
Value
bool bool bool

true if the torch LED is enabled; otherwise, false.

Attributes

Remarks

On some devices the torch will not emit light, even if Enabled is set to true, unless the device has a preview stream running and is actively capturing video. The recommended order of operations is to turn on the video preview, then turn on the torch by setting Enabled to true, and then initiate video capture. On some devices the torch will light up after the preview is started. On other devices, the torch may not light up until video capture is started.

PowerPercent PowerPercent PowerPercent

Gets or sets the intensity of the torch LED.

public float PowerPercent { get; set; }public float PowerPercent { get; set; }Public ReadWrite Property PowerPercent As float
Value
float float float

The power percent the torch LED is set to.

Attributes

PowerSupported PowerSupported PowerSupported

Gets a value that specifics if the device allows the torch LED power settings to be changed.

public PlatForm::Boolean PowerSupported { get; }public bool PowerSupported { get; }Public ReadOnly Property PowerSupported As bool
Value
bool bool bool

true if the power settings can be modified; otherwise, false.

Attributes

Supported Supported Supported

Gets a value that specifies if the capture device supports the torch control.

public PlatForm::Boolean Supported { get; }public bool Supported { get; }Public ReadOnly Property Supported As bool
Value
bool bool bool

true if the capture device supports the torch control; otherwise, false.

Attributes