TorchControl TorchControl TorchControl TorchControl Class

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

Syntax

Declaration

public sealed class TorchControlpublic sealed class TorchControlPublic NotInheritable Class TorchControlpublic sealed class TorchControl

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 Supported.

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

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

Properties summary

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

Gets or sets the intensity of the torch LED.

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

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

Properties

  • Enabled
    Enabled
    Enabled
    Enabled

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

    public bool Enabled { get; set; }public bool Enabled { get; set; }Public ReadWrite Property Enabled As boolpublic bool Enabled { get; set; }

    Property Value

    • bool
      bool
      bool
      bool

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

    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
    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 floatpublic float PowerPercent { get; set; }

    Property Value

    • float
      float
      float
      float

      The power percent the torch LED is set to.

  • PowerSupported
    PowerSupported
    PowerSupported
    PowerSupported

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

    public bool PowerSupported { get; }public bool PowerSupported { get; }Public ReadOnly Property PowerSupported As boolpublic bool PowerSupported { get; }

    Property Value

    • bool
      bool
      bool
      bool

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

  • Supported
    Supported
    Supported
    Supported

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

    public bool Supported { get; }public bool Supported { get; }Public ReadOnly Property Supported As boolpublic bool Supported { get; }

    Property Value

    • bool
      bool
      bool
      bool

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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Media.Devices.dll