Picture This Screen Capture

To capture your entire screen and automatically save the screenshot, tap the Windows key + Print Screen key. Your screen will briefly go dim to indicate that you've just taken a screenshot, and the. To Take a Screenshot of Part of Your Screen Press “Windows + Shift + S”. Your screen will appear grayed out and your mouse cursor will change. Click and drag on your screen to select the part of your screen you want to capture. Get the ultimate screen capture and video recording on Windows and Mac. Snagit is simple, powerful software to capture images and record videos of your computer screen. Start today for free! A screenshot, screen capture or screen dump, is a static picture of your computer screen’s display. The picture is a digital image taken by the operating system or by screenshot software and can be saved as a GIF, JPEG, TIFF, BMP, PNG or any other image format. With the browser of your choice, visit your blog’s main page.

-->

Starting in Windows 10, version 1803, the Windows.Graphics.Capture namespace provides APIs to acquire frames from a display or application window, to create video streams or snapshots to build collaborative and interactive experiences.

With screen capture, developers invoke secure system UI for end users to pick the display or application window to be captured, and a yellow notification border is drawn by the system around the actively captured item. In the case of multiple simultaneous capture sessions, a yellow border is drawn around each item being captured.

Note

The screen capture APIs are only supported on desktop and Windows Mixed Reality immersive headsets.

This article describes capturing a single image of the display or application window. For information on encoding frames captured from the screen to a video file, see Screen capture to video

Add the screen capture capability

The APIs found in the Windows.Graphics.Capture namespace require a general capability to be declared in your application's manifest:

  1. Open Package.appxmanifest in the Solution Explorer.
  2. Select the Capabilities tab.
  3. Check Graphics Capture.

Launch the system UI to start screen capture

Before launching the system UI, you can check to see if your application is currently able to take screen captures. 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. Use the IsSupported method in the GraphicsCaptureSession class to determine if UWP screen capture is supported:

Once you've verified that screen capture is supported, use the GraphicsCapturePicker class to invoke the system picker UI. The end user uses this UI to select the display or application window of which to take screen captures. The picker will return a GraphicsCaptureItem that will be used to create a GraphicsCaptureSession:

Because this is UI code, it needs to be called on the UI thread. If you're calling it from the code-behind for a page of your application (like MainPage.xaml.cs) this is done for you automatically, but if not, you can force it to run on the UI thread with the following code:

Create a capture frame pool and capture session

Using the GraphicsCaptureItem, you will create a Direct3D11CaptureFramePool with your D3D device, supported pixel format (DXGI_FORMAT_B8G8R8A8_UNORM), number of desired frames (which can be any integer), and frame size. The ContentSize property of the GraphicsCaptureItem class can be used as the size of your frame:

Next, get an instance of the GraphicsCaptureSession class for your Direct3D11CaptureFramePool by passing the GraphicsCaptureItem to the CreateCaptureSession method:

Once the user has explicitly given consent to capturing an application window or display in the system UI, the GraphicsCaptureItem can be associated to multiple CaptureSession objects. This way your application can choose to capture the same item for various experiences.

To capture multiple items at the same time, your application must create a capture session for each item to be captured, which requires invoking the picker UI for each item that is to be captured.

Acquire capture frames

With your frame pool and capture session created, call the StartCapture method on your GraphicsCaptureSession instance to notify the system to start sending capture frames to your app:

To acquire these capture frames, which are Direct3D11CaptureFrame objects, you can use the Direct3D11CaptureFramePool.FrameArrived event:

It is recommended to avoid using the UI thread if possible for FrameArrived, as this event will be raised every time a new frame is available, which will be frequent. If you do choose to listen to FrameArrived on the UI thread, be mindful of how much work you're doing every time the event fires.

Alternatively, you can manually pull frames with the Direct3D11CaptureFramePool.TryGetNextFrame method until you get all of the frames that you need.

The Direct3D11CaptureFrame object contains the properties ContentSize, Surface, and SystemRelativeTime. The SystemRelativeTime is QPC (QueryPerformanceCounter) time that can be used to synchronize other media elements.

Process capture frames

Free Screen Picture Capture

Each frame from the Direct3D11CaptureFramePool is checked out when calling TryGetNextFrame, and checked back in according to the lifetime of the Direct3D11CaptureFrame object. For native applications, releasing the Direct3D11CaptureFrame object is enough to check the frame back in to the frame pool. For managed applications, it is recommended to use the Direct3D11CaptureFrame.Dispose (Close in C++) method. Direct3D11CaptureFrame implements the IClosable interface, which is projected as IDisposable for C# callers.

Applications should not save references to Direct3D11CaptureFrame objects, nor should they save references to the underlying Direct3D surface after the frame has been checked back in.

While processing a frame, it is recommended that applications take the ID3D11Multithread lock on the same device that is associated with the Direct3D11CaptureFramePool object.

The underlying Direct3D surface will always be the size specified when creating (or recreating) the Direct3D11CaptureFramePool. If content is larger than the frame, the contents are clipped to the size of the frame. If the content is smaller than the frame, then the rest of the frame contains undefined data. It is recommended that applications copy out a sub-rect using the ContentSize property for that Direct3D11CaptureFrame to avoid showing undefined content.

Take a screenshot

In our example, we convert each Direct3D11CaptureFrame into a CanvasBitmap, which is part of the Win2D APIs.

Once we have the CanvasBitmap, we can save it as an image file. In the following example, we save it as a PNG file in the user's Saved Pictures folder.

React to capture item resizing or device lost

During the capture process, applications may wish to change aspects of their Direct3D11CaptureFramePool. This includes providing a new Direct3D device, changing the size of the frame buffers, or even changing the number of buffers within the pool. In each of these scenarios, the Recreate method on the Direct3D11CaptureFramePool object is the recommended tool.

When Recreate is called, all existing frames are discarded. This is to prevent handing out frames whose underlying Direct3D surfaces belong to a device that the application may no longer have access to. For this reason, it may be wise to process all pending frames before calling Recreate.

Putting it all together

The following code snippet is an end-to-end example of how to implement screen capture in a UWP application. In this sample, we have two buttons in the front-end: one calls Button_ClickAsync, and the other calls ScreenshotButton_ClickAsync.

Note

This snippet uses Win2D, a library for 2D graphics rendering. See their documentation for information about how to set it up for your project.

Record a video

If you want to record a video of your application, you can follow the walkthrough presented in the article Screen capture to video. Or, you can use Windows.Media.AppRecording namespace. This is part of the Desktop extension SDK, so it only works on desktop and requires that you add a reference to it from your project. See Programming with extension SDKs for more information.

See also

Take a snapshot to copy words or images from all or part of your PC screen. Use Snipping Tool to make changes or notes, then save, and share.

Windows 10 has another screenshot app you might also like to try. When you open Snipping Tool, you’ll see an invitation and keyboard shortcut to Snip & Sketch. For more info on this app, see How to take and annotate screenshots on Windows 10.

Capture any of the following types of snips:

Free-form snip

Draw a free-form shape around an object.

Rectangular snip

Drag the cursor around an object to form a rectangle.

Window snip

Select a window, such as a dialog box, that you want to capture.

Full-screen snip

Capture the entire screen.

When you capture a snip, it's automatically copied to the Snipping Tool window where you make changes, save, and share.

Open Snipping Tool

For Windows 10

Select the Start button, type snipping tool in the search box on the taskbar, and then select Snipping Tool from the list of results.

For Windows 8.1 / Windows RT 8.1

Swipe in from the right edge of the screen, tap Search (or if you're using a mouse, point to the lower-right corner of the screen, move the mouse pointer up, and then select Search), type snipping tool in the search box, and then select Snipping Tool from the list of results.

For Windows 7

Select the Start button, then type snipping tool in the search box, and then select Snipping Tool from the list of results.

Work with your screenshots

With your Snipping Tool open, select one of the following to create and work with your screenshots.

Capture a snip

In Snipping Tool, select Mode. In earlier versions of Windows, select the arrow next to the New button. Next, when you choose the kind of snip you want, you’ll see the whole screen change slightly to gray. Then, choosing from anything currently displayed on the screen, select the area of your screen that you want to capture.

Capture a snip of a menu

  1. After you open Snipping Tool, open the menu that you want to capture. For Windows 7, press the Esc key before opening the menu.

  2. Press Ctrl + PrtScn keys. The entire screen changes to gray including the open menu.

  3. Select Mode, or in earlier versions of Windows, select the arrow next to the New button. Select the kind of snip you want, and then select the area of the screen capture that you want to capture.

Annotate a snip

After you capture a snip, you can write or draw on or around it by selecting the Pen or Highlighter buttons. Select Eraser to remove the lines you've drawn.

Save a snip

  1. After you capture a snip, select the Save Snip button.

  2. In the Save As box, type a file name, location, and type, and then select Save.

Remove the URL

When you capture a snip from a browser window and save it as an HTML file, the URL appears below the snip. To prevent the URL from appearing:

  1. In the Snipping Tool, select the Options button.

  2. In theSnipping Tools Options box, clear the Include URL below snips (HTML only) check box, then select OK.

Share a snip

After you capture a snip, select the arrow next to the Send Snip button, and then select an option from the list.

Keyboard shortcuts to use in Snipping Tool

Picture This Screen Capture Wallpaper

Press these keys

To do this

Alt + M

Choose a snipping mode.

Alt + N

Create a new snip in the same mode as the last one.

Shift + arrow keys

Move the cursor to select from different types of snips.

Alt + D

Delay capture by 1-5 seconds

Ctrl + C

Copy the snip to clipboard

Ctrl +

Save the snip

Enlarge, rotate, or crop your snip

Picture this screen capture screen

With your capture open in Snipping Tool, select Edit > Edit with Paint 3D to use features for sizing, color, text, and many other enhancements.

Print a snip

In the folder where you’ve saved your snip, right click on the snip. Select Print from the options and make choices for how you want to print your image.

Place tool on the taskbar

In the search box on the taskbar, type snipping tool. You’ll see the Snipping Tool app and a list of actions you can take. Select Pin to taskbar.

Delay your screenshot

First, identify the menu or other components you want to capture. In Snipping Tool, select Delay and then select, for example, 5 seconds. Select Mode to start the 5-second countdown. Within 5 seconds, open a menu or otherwise compose your image. At 5 seconds, when you see the screen turn gray, use the mouse to draw around the area you want.

Related info

For info about other Windows 10 features, see What's new in recent Windows 10 updates.