Windows Dev Center

MediaDeviceControl class

Gets or sets a device setting on a camera.

Syntax


public ref class MediaDeviceControl sealed 

Attributes

[DualApiPartition()]
[MarshalingBehavior(Standard)]
[Threading(MTA)]
[Version(0x06020000)]

Members

The MediaDeviceControl class has these types of members:

Methods

The MediaDeviceControl class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
TryGetAuto Indicates whether automatic adjustment of the camera setting is enabled.
TryGetValue Gets the value of the camera setting.
TrySetAuto Enables or disables automatic adjustment of the camera setting.
TrySetValue Sets the camera setting.

 

Properties

The MediaDeviceControl class has these properties.

PropertyAccess typeDescription

Capabilities

Read-onlyGets the capabilities of the camera for this camera setting.

 

Remarks

Various properties on the VideoDeviceController object returns instances of the MediaDeviceControl object. Each VideoDeviceController property represents a particular setting on the camera, such as brightness or focus. Use the MediaDeviceControl object to:

  • Get or set the camera setting.
  • Enable automatic adjustment of the setting.
  • Get the range of values that the camera supports for the setting.
Note  : This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Examples

The following example shows how to get the Brightness on a VideoDeviceController. Note that Brightness is a MediaDeviceController.


// Get the step size, minimum value, and maximum value of the brightness property to set
// values on a slider control.

function setBrtSlider() {
    var videoDev = null;
    var bValue = null;

    var mediaDevice = new Windows.Media.Capture.MediaCapture();
    videoDev = mediaDevice.videoDeviceController;
   
    if (videoDev.brightness.capabilities.step !== 0)
    {
        bValue = videoDev.brightness.tryGetValue();
        document.getElementById("slBrt").value = bValue.value;
        document.getElementById("slBrt").min = videoDev.brightness.capabilities.min;
        document.getElementById("slBrt").max = videoDev.brightness.capabilities.max;
        document.getElementById("slBrt").step = videoDev.brightness.capabilities.step;
    }
} 


Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.Devices
Windows::Media::Devices [C++]

Metadata

Windows.winmd

See also

Object

 

 

Show:
© 2015 Microsoft