WhiteBalanceControl WhiteBalanceControl WhiteBalanceControl WhiteBalanceControl Class

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

Syntax

Declaration

public sealed class WhiteBalanceControlpublic sealed class WhiteBalanceControlPublic NotInheritable Class WhiteBalanceControl

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(Windows.Media.Devices.ColorTemperaturePreset). Or call SetValueAsync(System.UInt32) to set a specific Value between the Min and Max.

You can find out if a device supports this control by checking 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 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 summary

Gets the maximum white balance value.

Gets the minimum white balance value.

Gets the color temperature preset.

Gets the step value.

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

Gets the color temperature value.

Methods summary

Asynchronously sets the color temperature Preset.

Asynchronously sets the color temperature Value.

Properties

  • Max
    Max
    Max
    Max

    Gets the maximum white balance value.

    public uint Max { get; }public uint Max { get; }Public ReadOnly Property Max As uint

    Property Value

    • uint
      uint
      uint
      uint

      The maximum white balance value.

  • Min
    Min
    Min
    Min

    Gets the minimum white balance value.

    public uint Min { get; }public uint Min { get; }Public ReadOnly Property Min As uint

    Property Value

    • uint
      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

    Property Value

  • Step
    Step
    Step
    Step

    Gets the step value.

    public uint Step { get; }public uint Step { get; }Public ReadOnly Property Step As uint

    Property Value

    • uint
      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 bool Supported { get; }public bool Supported { get; }Public ReadOnly Property Supported As bool

    Property Value

    • bool
      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 uint Value { get; }public uint Value { get; }Public ReadOnly Property Value As uint

    Property Value

    • uint
      uint
      uint
      uint

      The color temperature value.

    Remarks

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

Methods

  • SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset)
    SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset)
    SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset)
    SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset)

    Asynchronously sets the color temperature Preset.

    public IAsyncAction SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset preset)public IAsyncAction SetPresetAsync(Windows.Media.Devices.ColorTemperaturePreset preset)Public Function SetPresetAsync(preset As Windows.Media.Devices.ColorTemperaturePreset) As IAsyncAction

    Parameters

    Returns

    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 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(Windows.Media.Devices.ColorTemperaturePreset) and specify the Manual preset and do not set a value on the control using SetValueAsync(System.UInt32). 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(System.UInt32) because this value is not guaranteed to be correct.

  • SetValueAsync(System.UInt32)
    SetValueAsync(System.UInt32)
    SetValueAsync(System.UInt32)
    SetValueAsync(System.UInt32)

    Asynchronously sets the color temperature Value.

    public IAsyncAction SetValueAsync(System.UInt32 temperature)public IAsyncAction SetValueAsync(System.UInt32 temperature)Public Function SetValueAsync(temperature As System.UInt32) As IAsyncAction

    Parameters

    • temperature
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

      The temperature value to set the Value property to.

    Returns

    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 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(Windows.Media.Devices.ColorTemperaturePreset) and specify the Manual preset and do not set a value on the control using SetValueAsync(System.UInt32). 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(System.UInt32) because this value is not guaranteed to be correct.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

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

Details

Assembly

Windows.Media.Devices.dll