MediaCapture.CreateRelativePanelWatcher 方法

定義

建立 MediaCaptureRelativePanelWatcher 類別的新實例,此類別會監視與所提供 DisplayRegion相關聯的面板,讓應用程式在面板的相對位置變更時收到通知。

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

參數

displayRegion
DisplayRegion

監視相關聯面板是否有變更的 DisplayRegion 。 通常這個顯示區域會是相機檢視尋找工具 UI 元素,如此一來,如果包含檢視尋找器之面板的相對位置變更,應用程式就會發出警示。

傳回

MediaCaptureRelativePanelWatcher類別的新實例。

Windows 需求

裝置系列
Windows 10, version 2004 (已於 10.0.19041.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v10.0 引進)

備註

每當與監看員相關聯的DisplayRegion變更時,應用程式應該實作DisplayRegion.Changed 事件的處理常式。 在此處理程式中,應用程式應該處置監看員物件、重新建立物件,然後重新註冊 MediaCaptureRelativePanelWatcher.Changed 事件的處理常式。

適用於

另請參閱

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