Skip to main content

XAppCaptureOpenScreenshotStream

Opens a screenshot stream.

Syntax

Parameters

localId   _In_
Type: char*
Local ID of the screenshot returned in XAppCaptureTakeScreenshotResult after calling XAppCaptureTakeScreenshot. screenshotFormat   _In_
Type: XAppCaptureScreenshotFormatFlag
Screenshot format flag returned in XAppCaptureTakeScreenshotResult after calling XAppCaptureTakeScreenshot. handle   _Out_
Type: XAppCaptureScreenshotStreamHandle*
Screenshot stream handle returned as a result of opening the stream. totalBytes   _Out_opt_
Type: uint64_t*
Total number of bytes in the stream.

Return value

Type: HRESULT Function result.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
Screenshots are not accessible from the game partition and so you must open a stream in order to retrieve screenshots taken by the user or with XAppCaptureTakeScreenshot. XAppCaptureTakeScreenshot returns a localID in its result which is used in this function to retrieve the proper screenshot. The localID will be valid as long as the screenshot is retained on disk. There is only a limited amount of space on the console in which screenshots are stored. Older screenshots will be deleted when the allotted space is filled. This could potentially cause the open screenshot function to miss on a localID. After opening the stream you may read the screenshot with XAppCaptureReadScreenShotStream. Finally every stream needs to be closed with XAppCaptureCloseScreenshotStream in order to avoid a memory leak.

Requirements

Header: XAppCapture.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

GameDVR Overview
XAppCapture Members
XAppCaptureReadScreenShotStream
XAppCaptureTakeScreenshot
XAppCaptureCloseScreenshotStream
Last modified on August 20, 2026