openharmony 鸿蒙 capi-oh-display-capture-h

2025-06-12 浏览 (1)

oh_display_capture.h

Overview

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

File to include: <window_manager/oh_display_capture.h>

Library: libnative_display_manager.so

System capability: SystemCapability.WindowManager.WindowManager.Core

Since: 14

Related module: OH_DisplayManager

Summary

Function

NameDescription
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

ParameterDescription
uint32_t displayIdID of the display. The value must be a non-negative integer.
[OH_PixelmapNative](../apis-image-kit/capi-oh-pixelmapnative.md **pixelMapDouble pointer to an OH_PixelmapNative object, which is the screenshot taken.

Return value

TypeDescription
NativeDisplayManager_ErrorCodeStatus 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

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/tcz9iW