harmony 鸿蒙oh_display_capture.h

  • 2025-06-12
  • 浏览 (4)

oh_display_capture.h

Overview

The oh_display_capture.h file declares the capability to take screenshots.

File to include:

Library: libnative_display_manager.so

System capability: SystemCapability.WindowManager.WindowManager.Core

Since: 14

Related module: OH_DisplayManager

Summary

Function

|Name|Description| |–|–| |NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CaptureScreenPixelmap(uint32_t displayId,OH_PixelmapNative **pixelMap)|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.|

Function Description

OH_NativeDisplayManager_CaptureScreenPixelmap()

NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CaptureScreenPixelmap(uint32_t displayId,OH_PixelmapNative **pixelMap)

Description

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.

System capability: SystemCapability.Window.SessionManager.Core

Required permissions: ohos.permission.CUSTOM_SCREEN_CAPTURE

Since: 14

Parameters

|Parameter|Description| |–|–| |uint32_t displayId|ID of the display. The value must be a non-negative integer.| |[OH_PixelmapNative](../apis-image-kit/capi-oh-pixelmapnative.md **pixelMap|Double pointer to an OH_PixelmapNative object, which is the screenshot taken.|

Return value

|Type|Description| |–|–| |NativeDisplayManager_ErrorCode|Status code defined in NativeDisplayManager_ErrorCode.|

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

0  赞