From 8ed36d614f2df7492b2bac8791230e855dc5afb1 Mon Sep 17 00:00:00 2001 From: yaozhupeng Date: Mon, 30 Jan 2023 10:15:25 +0800 Subject: [PATCH] fix image rotate callback monthly Signed-off-by: yaozhupeng --- .../application-dev/reference/apis/js-apis-image.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 68eac8890e..05d5f7c4e5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -735,9 +735,15 @@ rotate(angle: number, callback: AsyncCallback\): void **示例:** ```js -async function Demo() { - await pixelmap.rotate(90.0); -} +var angle = 90.0; +pixelmap.rotate(angle, (err) => { + if (err) { + console.error("Failed to set rotation."); + return; + } else { + console.log("Succeeded in setting rotation."); + } +}) ``` ### rotate9+ -- GitLab