-api-id | -api-type |
---|---|
M:Windows.Graphics.Capture.GraphicsCaptureItem.TryCreateFromWindowId(Windows.UI.WindowId) |
winrt method |
Attempts to create a GraphicsCaptureItem that represents the window with the specified WindowId.
The WindowId with which to construct the GraphicsCaptureItem.
Upon success, returns a GraphicsCaptureItem that represents the given window.
Before attempting to create a GraphicsCaptureItem with this method, you must call GraphicsCaptureAccess.RequestAccessAsync, passing in a value of GraphicsCaptureAccessKind.Programmatic. To call RequestAccessAsync with GraphicsCaptureAccessKind.Programmatic, you must declare the graphicsCaptureProgrammatic capability in your app's package manifest. For more information, see App capability declarations.