Freigeben über


XAppCaptureTakeDiagnosticScreenshot

Takes a diagnostic screenshot from your app.

Syntax

HRESULT XAppCaptureTakeDiagnosticScreenshot(  
         bool gamescreenOnly,  
         XAppCaptureScreenshotFormatFlag captureFlags,  
         const char* filenamePrefix,  
         XAppCaptureDiagnosticScreenshotResult* result  
)  

Parameters

gamescreenOnly   _In_
Type: bool

Determines whether or not only the gamescreen will be captured. If set to false it is possible that some UI like an onscreen keyboard could be captured in addition to the game screen.

captureFlags   _In_
Type: XAppCaptureScreenshotFormatFlag

Determines whether the capture will be an SDR or HDR capture.

filenamePrefix   _In_opt_
Type: char*

Desired prefix for the file name, is optional, will be appended to the front of the diagnostic file name.

result   _Out_
Type: XAppCaptureDiagnosticScreenshotResult*

The resulting captured screenshot.

Return value

Type: HRESULT

Function result.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

Unlike XAppCaptureTakeScreenshot, calling this function does not trigger a UI notification. XAppCaptureTakeDiagnosticScreenshot uses XAppCaptureScreenshotFormatFlag to designate whether the screen capture will be in SDR, HDR, or both. However, you still must be running in HDR to take an HDR capture. Screenshots are saved to a game accessible partition. The XAppCaptureDiagnosticScreenshotResult contains an array of XAppCaptureScreenshotFile, each struct contains a file path to the screenshot.

This function will only be available on development kits. On retail kits this api will return an error immediately.

Requirements

Header: XAppCapture.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

GameDVR Overview
XAppCapture Members
XAppCaptureDiagnosticScreenshotResult
XAppCaptureScreenshotFormatFlag
XAppCaptureDiagnosticScreenshotResult
XAppCaptureScreenshotFile