Delen via


TorchControl.Enabled Property

Definition

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

public:
 property bool Enabled { bool get(); void set(bool value); };
bool Enabled();

void Enabled(bool value);
public bool Enabled { get; set; }
var boolean = torchControl.enabled;
torchControl.enabled = boolean;
Public Property Enabled As Boolean

Property Value

Boolean

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.

Applies to