Search code examples
c#screenshotwin-universal-app

Universal Windows Library (UWP) Way to take screenshot?


I would like to create a ScreenCaptureLib.dll which is intended to be built for Universal Windows.

We already have the following using Windows.Forms: https://github.com/ShareX/ShareX/tree/master/ShareX.ScreenCaptureLib

Obviously none of the Windows Forms code does not work and I would like some pointers in the right direction to get started.


Solution

  • You may follow the official document for Record the screen with ScreenCapture, but please notice that:

    The ScreenCapture API is only available on mobile devices.

    And for now there is no API can be used directly to capture the screen on a desktop from an UWP app. However, as a workaround method, we can render the XAML tree to a bitmap, to do this, please refer to Capturing Snapshot in Windows 8.1 Store App.

    You may also submit a request to add this new feature for developing through the Windows Feedback tool.

    Update:

    The ScreenCapture feature is only supported for mobile devices running Windows Phone 8.1. This API is not supported on Windows 10.