WhiteBalanceControl
WhiteBalanceControl
WhiteBalanceControl
WhiteBalanceControl
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// You can use this class in JavaScript.
- Attributes
| 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 Max
Gets the maximum white balance value.
public : unsigned int Max { get; }public uint Max { get; }Public ReadOnly Property Max As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The maximum white balance value.
Min Min Min Min
Gets the minimum white balance value.
public : unsigned int Min { get; }public uint Min { get; }Public ReadOnly Property Min As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The minimum white balance value.
Preset Preset Preset Preset
Gets the color temperature preset.
public : ColorTemperaturePreset Preset { get; }public ColorTemperaturePreset Preset { get; }Public ReadOnly Property Preset As ColorTemperaturePreset// You can use this property in JavaScript.
The color temperature preset.
Step Step Step Step
Gets the step value.
public : unsigned int Step { get; }public uint Step { get; }Public ReadOnly Property Step As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The step value.
Supported 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// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
true if the capture device supports the white balance control; otherwise, false.
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 Value
Gets the color temperature value.
public : unsigned int Value { get; }public uint Value { get; }Public ReadOnly Property Value As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The color temperature value.
Remarks
White balance is specified as a color temperature in degrees Kelvin.
Methods
SetPresetAsync(ColorTemperaturePreset) 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// You can use this method in JavaScript.
The color temperate preset to set the Preset property to.
The object that is used to control the asynchronous operation.
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) 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// You can use this method in JavaScript.
- temperature
- unsigned int UInt32 UInt32 UInt32
The temperature value to set the Value property to.
The object that is used to control the asynchronous operation.
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.