mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-27 01:11:35 +00:00
组件截图:新增getSync接口
Signed-off-by: huqingyun <huqingyun1@huawei.com> Change-Id: I57c8ab12c7328c0a7ae9c61c7f1bf31c2f5864b4
This commit is contained in:
parent
226c7c4257
commit
6e3449fafc
21
api/@ohos.arkui.UIContext.d.ts
vendored
21
api/@ohos.arkui.UIContext.d.ts
vendored
@ -2424,6 +2424,27 @@ export class ComponentSnapshot {
|
||||
*/
|
||||
createFromBuilder(builder: CustomBuilder, delay?: number,
|
||||
checkImageStatus?: boolean, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap>;
|
||||
|
||||
/**
|
||||
* Take a screenshot of the specified component in synchronous mode,
|
||||
* this mode will block the main thread, please use it with caution, the maximum
|
||||
* waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown.
|
||||
*
|
||||
* @param { string } id - Target component ID, set by developer through .id attribute.
|
||||
* @param { componentSnapshot.SnapshotOptions } [options] - Define the snapshot options.
|
||||
* @returns { image.PixelMap } The snapshot result in PixelMap format.
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes:
|
||||
* <br> 1. Mandatory parameters are left unspecified.
|
||||
* <br> 2. Incorrect parameters types.
|
||||
* <br> 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 100001 - Invalid ID.
|
||||
* @throws { BusinessError } 160002 - Timeout.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
getSync(id: string, options?: componentSnapshot.SnapshotOptions): image.PixelMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
21
api/@ohos.arkui.componentSnapshot.d.ts
vendored
21
api/@ohos.arkui.componentSnapshot.d.ts
vendored
@ -209,6 +209,27 @@ declare namespace componentSnapshot {
|
||||
*/
|
||||
function createFromBuilder(builder: CustomBuilder, delay?: number,
|
||||
checkImageStatus?: boolean, options?: SnapshotOptions): Promise<image.PixelMap>;
|
||||
|
||||
/**
|
||||
* Take a screenshot of the specified component in synchronous mode,
|
||||
* this mode will block the main thread, please use it with caution, the maximum
|
||||
* waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown.
|
||||
*
|
||||
* @param { string } id - Target component ID, set by developer through .id attribute.
|
||||
* @param { SnapshotOptions } [options] - Define the snapshot options.
|
||||
* @returns { image.PixelMap } The snapshot result in PixelMap format.
|
||||
* @throws { BusinessError } 401 - Parameter error. Possible causes:
|
||||
* <br> 1. Mandatory parameters are left unspecified.
|
||||
* <br> 2. Incorrect parameters types.
|
||||
* <br> 3. Parameter verification failed.
|
||||
* @throws { BusinessError } 100001 - Invalid ID.
|
||||
* @throws { BusinessError } 160002 - Timeout.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
function getSync(id: string, options?: SnapshotOptions): image.PixelMap;
|
||||
}
|
||||
|
||||
export default componentSnapshot;
|
||||
|
Loading…
Reference in New Issue
Block a user