• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# oh_display_capture.h
2<!--Kit: ArkUI-->
3<!--Subsystem: Window-->
4<!--Owner: @oh_wangxk; @logn-->
5<!--Designer: @hejunfei1991-->
6<!--Tester: @qinliwen0417-->
7<!--Adviser: @ge-yafang-->
8
9## Overview
10
11The file declares the capability to take screenshots.
12
13**File to include**: <window_manager/oh_display_capture.h>
14
15**Library**: libnative_display_manager.so
16
17**System capability**: SystemCapability.WindowManager.WindowManager.Core
18
19**Since**: 14
20
21**Related module**: [OH_DisplayManager](capi-oh-displaymanager.md)
22
23## Summary
24
25### Function
26
27| Name| Description|
28| -- | -- |
29| [NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CaptureScreenPixelmap(uint32_t displayId,OH_PixelmapNative **pixelMap)](#oh_nativedisplaymanager_capturescreenpixelmap) | Takes a screenshot of the entire screen. This function can be used only on tablets and 2-in-1 devices. It can be used to capture a full-screen screenshot on the specified display.|
30
31## Function Description
32
33### OH_NativeDisplayManager_CaptureScreenPixelmap()
34
35```
36NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CaptureScreenPixelmap(uint32_t displayId,OH_PixelmapNative **pixelMap)
37```
38
39**Description**
40
41Takes a screenshot of the entire screen. This function can be used only on tablets and 2-in-1 devices. It can be used to capture a full-screen screenshot on the specified display.
42
43**System capability**: SystemCapability.Window.SessionManager.Core
44
45**Required permissions**: ohos.permission.CUSTOM_SCREEN_CAPTURE
46
47**Since**: 14
48
49**Parameters**
50
51| Parameter| Description|
52| -- | -- |
53| uint32_t displayId | ID of the display. The value must be a non-negative integer.|
54| [OH_PixelmapNative](../apis-image-kit/capi-image-nativemodule-oh-pixelmapnative.md) **pixelMap | Double pointer to an OH_PixelmapNative object, which is the screenshot taken.|
55
56**Return value**
57
58| Type| Description|
59| -- | -- |
60| [NativeDisplayManager_ErrorCode](capi-oh-display-info-h.md#nativedisplaymanager_errorcode) | Status code defined in [NativeDisplayManager_ErrorCode](capi-oh-display-info-h.md#nativedisplaymanager_errorcode).|
61