diff --git a/zh-cn/application-dev/reference/apis/js-apis-image.md b/zh-cn/application-dev/reference/apis/js-apis-image.md index c7629322b08912ddfea84bc6f638e20de16a4838..33129ee1db465d97b2f8d152a7938b78fa0893bd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -2039,7 +2039,12 @@ dequeueImage(callback: AsyncCallback\): void **示例:** ```js -111 +creator.dequeueImage((err, img) => { + if (err) { + console.info('dequeueImage succeeded.'); + } + console.info('dequeueImage failed.')); +}); ``` ### dequeueImage9+ @@ -2059,7 +2064,11 @@ dequeueImage(): Promise\ **示例:** ```js -111 +creator.dequeueImage().then(img => { + console.info('dequeueImage succeeded.'); +}).catch(error => { + console.log('dequeueImage failed: ' + error); +}) ``` ### dequeueImage9+ @@ -2080,7 +2089,12 @@ queueImage(interface: Image, callback: AsyncCallback\): void **示例:** ```js -111 +creator.queueImage(img, (err) => { + if (err) { + console.info('dequeueImage failed: ' + err); + } + console.info('dequeueImage succeeded'); +}) ``` ### dequeueImage9+ @@ -2106,7 +2120,11 @@ queueImage(interface: Image): Promise\ **示例:** ```js -111 +creator.queueImage(img).then(() => { + console.info('dequeueImage succeeded.'); +}).catch(error => { + console.info('dequeueImage failed: ' + error); +}) ``` ### on9+ @@ -2127,7 +2145,12 @@ on(type: 'imageRelease', callback: AsyncCallback\): void **示例:** ```js -111 +creator.on('imageRelease', (err) => { + if (err) { + console.info('on faild' + err); + } + console.info('on succeeded'); +}) ``` ### release9+ @@ -2147,7 +2170,12 @@ release(callback: AsyncCallback\): void **示例:** ```js -111 +creator.release((err) => { + if (err) { + console.info('release failed: ' + err); + } + console.info('release succeeded'); +}); ``` ### release9+ @@ -2164,7 +2192,11 @@ release(): Promise\ **示例:** ```js -111 +creator.release().then(() => { + console.info('release succeeded'); +}).catch(error => { + console.info('release failed'); +}) ``` ## Image9+