Dela via


MediaCapture.CreateRelativePanelWatcher Method

Definition

Creates a new instance of the MediaCaptureRelativePanelWatcher class, which monitors the panel associated with the provided DisplayRegion, so that the app receives notifications when the relative location of the panel changes.

public:
 virtual MediaCaptureRelativePanelWatcher ^ CreateRelativePanelWatcher(StreamingCaptureMode captureMode, DisplayRegion ^ displayRegion) = CreateRelativePanelWatcher;
MediaCaptureRelativePanelWatcher CreateRelativePanelWatcher(StreamingCaptureMode const& captureMode, DisplayRegion const& displayRegion);
public MediaCaptureRelativePanelWatcher CreateRelativePanelWatcher(StreamingCaptureMode captureMode, DisplayRegion displayRegion);
function createRelativePanelWatcher(captureMode, displayRegion)
Public Function CreateRelativePanelWatcher (captureMode As StreamingCaptureMode, displayRegion As DisplayRegion) As MediaCaptureRelativePanelWatcher

Parameters

captureMode
StreamingCaptureMode

A value from the StreamingCaptureMode enumeration enumeration.

displayRegion
DisplayRegion

A DisplayRegion for which the associated panel is monitored for changes. Typically this display region will be the camera view finder UI element, so that the app is alerted if the relative location of the panel containing the view finder changes.

Returns

A new instance of the MediaCaptureRelativePanelWatcher class.

Windows requirements

Device family
Windows 10, version 2004 (introduced in 10.0.19041.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v10.0)

Remarks

Apps should implement a handler for the DisplayRegion.Changed Event that is raised whenever the DisplayRegion associated with the watcher changes. In this handler, apps should dispose of the watcher object, recreate the object, and reregister a handler for the MediaCaptureRelativePanelWatcher.Changed event.

Applies to

See also

  • <xref:Windows.Media.Capture.MediaCaptureRelativePanelWatcher%0a%5bDisplayRegion%5d(%2fuwp%2fapi%2fwindows.ui.windowmanagement.displayregion)>