From 464983cb3280bed8c04fe5f1e44b68af5f83e426 Mon Sep 17 00:00:00 2001 From: gloria <80926032@qq.com> Date: Tue, 9 Aug 2022 02:19:01 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90OpenHarmony=E5=BC=80=E6=BA=90=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E8=80=85=E8=AE=A1=E5=88=922022=E3=80=91js-apis-image?= =?UTF-8?q?=20=E6=9B=B4=E6=94=B9=E6=8B=BC=E5=86=99=E9=97=AE=E9=A2=98=20Sig?= =?UTF-8?q?ned-off-by:=20gloria=20<80926032@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference/apis/js-apis-image.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 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 2ae0461c83..ffbaa2705f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-image.md +++ b/zh-cn/application-dev/reference/apis/js-apis-image.md @@ -34,7 +34,7 @@ createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise\ { @@ -61,7 +61,7 @@ createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: As ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (pixelmap) => { }) @@ -188,7 +188,7 @@ readPixels(area: PositionArea, callback: AsyncCallback\): void ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (err, pixelmap) => { if(pixelmap == undefined){ @@ -229,7 +229,7 @@ writePixels(area: PositionArea): Promise\ ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts) .then( pixelmap => { @@ -272,7 +272,7 @@ writePixels(area: PositionArea, callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 说明 | | --------- | ------------------------------ | ---- | ------------------------------ | | area | [PositionArea](#positionarea7) | 是 | 区域,根据区域写入。 | -| callback: | AsyncCallback\ | 是 | 获取回调,失败时返回错误信息。 | +| callback | AsyncCallback\ | 是 | 获取回调,失败时返回错误信息。 | **示例:** @@ -317,7 +317,7 @@ writeBufferToPixels(src: ArrayBuffer): Promise\ ```js const color = new ArrayBuffer(96); const pixelMap = new ArrayBuffer(400); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); pixelMap.writeBufferToPixels(color).then(() => { console.log("Succeeded in writing data from a buffer to a PixelMap."); }).catch((err) => { @@ -345,7 +345,7 @@ writeBufferToPixels(src: ArrayBuffer, callback: AsyncCallback\): void ```js const color = new ArrayBuffer(96);\ const pixelMap = new ArrayBuffer(400); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); pixelMap.writeBufferToPixels(color, function(err) { if (err) { console.error("Failed to write data from a buffer to a PixelMap."); @@ -399,7 +399,7 @@ getImageInfo(callback: AsyncCallback\): void ```js pixelmap.getImageInfo((imageInfo) => { - console.log("Succeeded in obtaining the image pixel map information.."); + console.log("Succeeded in obtaining the image pixel map information."); }) ``` @@ -421,7 +421,7 @@ getBytesNumberPerRow(): number ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (err,pixelmap) => { let rowCount = pixelmap.getBytesNumberPerRow(); @@ -466,7 +466,7 @@ release():Promise\ ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (pixelmap) => { pixelmap.release().then(() => { @@ -495,7 +495,7 @@ release(callback: AsyncCallback\): void ```js const color = new ArrayBuffer(96); -let bufferArr = new Unit8Array(color); +let bufferArr = new Uint88Array(color); let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } image.createPixelMap(color, opts, (pixelmap) => { pixelmap.release().then(() => { @@ -1009,7 +1009,7 @@ imagePackerApi.packing(pixelMapApi, packOpts) .then( data => { console.log('Succeeded in packing the image.'); }).catch(error => { - console.log('Failed to pack the image..'); + console.log('Failed to pack the image.'); }) ``` -- GitLab