openharmony 鸿蒙 arkts-apis-photoAccessHelper-QuickImageDataHandler

2026-08-25 浏览 (1)

Interface (QuickImageDataHandler)

QuickImageDataHandler is a media asset handler used to customize the media asset processing logic in onDataPrepared.

NOTE

  • The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
  • The initial APIs of this interface are supported since API version 13.

Modules to Import

import { photoAccessHelper } from '@kit.MediaLibraryKit';

onDataPrepared13+

onDataPrepared(data: T, imageSource: image.ImageSource, map: Map<string, string>): void

Called when the requested image is ready. If an error occurs, data returned by the callback is undefined.

Information returned by map:

Map KeyDescription
'quality'Image quality. The value high means high quality, and low means poor quality.

System capability: SystemCapability.FileManagement.PhotoAccessHelper.Core

Parameters

NameTypeMandatoryDescription
dataTYesData of the image asset that is ready. It is of the generic type and supports the Picture type.
imageSourceimage.ImageSourceYesData of the image asset that is ready.
map13+Map<string, string>YesAdditional information about the image asset, such as the image quality. Currently, only quality is supported.

Example

import { image } from '@kit.ImageKit';

class MediaHandler implements photoAccessHelper.QuickImageDataHandler<image.Picture> {
  onDataPrepared(data: image.Picture, imageSource: image.ImageSource, map: Map<string, string>) {
    console.info('on image data prepared');
  }
}

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-mediaassetmanager-oh-mediaassetmanager

openharmony 鸿蒙 arkts-apis-photoAccessHelper-MediaAssetProgressHandler

openharmony 鸿蒙 arkts-apis-photoAccessHelper-AbsAlbum

openharmony 鸿蒙 arkts-apis-photoAccessHelper-PhotoAccessHelper

openharmony 鸿蒙 capi-media-access-helper-capi-h

openharmony 鸿蒙 arkts-apis-photoAccessHelper-PhotoAsset

openharmony 鸿蒙 capi-mediaassetmanager-oh-movingphoto

openharmony 鸿蒙 capi-mediaassetmanager

openharmony 鸿蒙 capi-mediaassetmanager-medialibrary-requestid

openharmony 鸿蒙 errorcode-medialibrary

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