White​Balance​Control White​Balance​Control White​Balance​Control Class

Definition

Provides functionality for controlling the white balance settings on a capture device.

public : sealed class WhiteBalanceControl : IWhiteBalanceControlpublic sealed class WhiteBalanceControl : IWhiteBalanceControlPublic NotInheritable Class WhiteBalanceControl Implements IWhiteBalanceControl
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The WhiteBalanceControl gives apps additional control over the white balance settings on a device. You can use one of the ColorTemperaturePreset values by calling SetPresetAsync. Or call SetValueAsync to set a specific Value between the Min and Max .

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

If the device does not support the WhiteBalanceControl, you can still use the WhiteBalance on the VideoCaptureDevice to set the value for the white balance color temperature.

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

White balance is specified as a color temperature in degrees Kelvin.

For how-to guidance for using the FocusControl, see Manual camera controls for photo and video capture.

Properties

Max Max Max

Gets the maximum white balance value.

public : unsigned short Max { get; }public uint Max { get; }Public ReadOnly Property Max As uint
Value
unsigned short uint uint

The maximum white balance value.

Attributes

Min Min Min

Gets the minimum white balance value.

public : unsigned short Min { get; }public uint Min { get; }Public ReadOnly Property Min As uint
Value
unsigned short uint uint

The minimum white balance value.

Attributes

Preset Preset Preset

Gets the color temperature preset.

public : ColorTemperaturePreset Preset { get; }public ColorTemperaturePreset Preset { get; }Public ReadOnly Property Preset As ColorTemperaturePreset
Attributes

Step Step Step

Gets the step value.

public : unsigned short Step { get; }public uint Step { get; }Public ReadOnly Property Step As uint
Value
unsigned short uint uint

The step value.

Attributes

Supported Supported Supported

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

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

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

Attributes

Remarks

If the device does not support the WhiteBalanceControl, you can still use the WhiteBalance on the VideoDeviceController to set the white balance color temperature.

Value Value Value

Gets the color temperature value.

public : unsigned short Value { get; }public uint Value { get; }Public ReadOnly Property Value As uint
Value
unsigned short uint uint

The color temperature value.

Attributes

Remarks

White balance is specified as a color temperature in degrees Kelvin.

Methods

SetPresetAsync(ColorTemperaturePreset) SetPresetAsync(ColorTemperaturePreset) SetPresetAsync(ColorTemperaturePreset)

Asynchronously sets the color temperature Preset.

public : IAsyncAction SetPresetAsync(ColorTemperaturePreset preset)public IAsyncAction SetPresetAsync(ColorTemperaturePreset preset)Public Function SetPresetAsync(preset As ColorTemperaturePreset) As IAsyncAction
Parameters
preset
ColorTemperaturePreset ColorTemperaturePreset ColorTemperaturePreset

The color temperate preset to set the Preset property to.

Returns

The object that is used to control the asynchronous operation.

Attributes

Remarks

Adjusting the white balance is only supported while the preview stream is running. Check to make sure that the preview stream is running before setting the white balance value or preset.

The ColorTemperaturePreset.Auto preset value instructs the system to automatically adjust the white balance level. For some scenarios, such as capturing a photo sequence where the white balance levels should be the same for each frame, you may want to lock the control to the current automatic value. To do this, call SetPresetAsync and specify the Manual preset and do not set a value on the control using SetValueAsync. This will cause the device to lock the current value. Do not attempt to read the current control value and then pass the returned value into SetValueAsync because this value is not guaranteed to be correct.

SetValueAsync(UInt32) SetValueAsync(UInt32) SetValueAsync(UInt32)

Asynchronously sets the color temperature Value.

public : IAsyncAction SetValueAsync(unsigned int temperature)public IAsyncAction SetValueAsync(UInt32 temperature)Public Function SetValueAsync(temperature As UInt32) As IAsyncAction
Parameters
temperature
unsigned int UInt32 UInt32

The temperature value to set the Value property to.

Returns

The object that is used to control the asynchronous operation.

Attributes

Remarks

White balance is specified as a color temperature in degrees Kelvin.

Adjusting the white balance is only supported while the preview stream is running. Check to make sure that the preview stream is running before setting the white balance value or preset.

The ColorTemperaturePreset.Auto preset value instructs the system to automatically adjust the white balance level. For some scenarios, such as capturing a photo sequence where the white balance levels should be the same for each frame, you may want to lock the control to the current automatic value. To do this, call SetPresetAsync and specify the Manual preset and do not set a value on the control using SetValueAsync. This will cause the device to lock the current value. Do not attempt to read the current control value and then pass the returned value into SetValueAsync because this value is not guaranteed to be correct.

See Also