' control without making a selection or hit Cancel.īecause this is UI code, it needs to be called on the UI thread. ' The item may be null if the user dismissed the ' The GraphicsCapturePicker follows the same pattern theĭim item As GraphicsCaptureItem = Await picker.PickSingleItemAsync() Public Async Function StartCaptureAsync() As Task We'll define this method later in the document. ![]() control without making a selection or hit Cancel. The item may be null if the user dismissed the GraphicsCaptureItem item = await picker.PickSingleItemAsync() Var picker = new GraphicsCapturePicker() The GraphicsCapturePicker follows the same pattern the The picker will return a GraphicsCaptureItem that will be used to create a GraphicsCaptureSession: public async Task StartCaptureAsync() The end user uses this UI to select the display or application window of which to take screen captures. Once you've verified that screen capture is supported, use the GraphicsCapturePicker class to invoke the system picker UI. If Not GraphicsCaptureSession.IsSupported ThenĬaptureButton.Visibility = Visibility.Collapsed Hide the capture UI if screen capture is not supported.ĬaptureButton.Visibility = Visibility.Collapsed If (!GraphicsCaptureSession.IsSupported()) Use the IsSupported method in the GraphicsCaptureSession class to determine if UWP screen capture is supported: // This runs when the application starts. ![]() There are several reasons why your application might not be able to use screen capture, including if the device does not meet hardware requirements or if the application targeted for capture blocks screen capture. Launch the system UI to start screen captureīefore launching the system UI, you can check to see if your application is currently able to take screen captures. Open Package.appxmanifest in the Solution Explorer.The APIs found in the namespace require a general capability to be declared in your application's manifest: For information on encoding frames captured from the screen to a video file, see Screen capture to video Add the screen capture capability This article describes capturing a single image of the display or application window. The screen capture APIs are only supported on desktop and Windows Mixed Reality immersive headsets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |