diff --git a/zh-cn/application-dev/media/image-decoding.md b/zh-cn/application-dev/media/image-decoding.md index c5991b9a7863b320946f3f0a26162b488693bc15..0bf549398dc30ed69aed778ec5c2ed614ca43b5f 100644 --- a/zh-cn/application-dev/media/image-decoding.md +++ b/zh-cn/application-dev/media/image-decoding.md @@ -73,7 +73,7 @@ 不同模型获取资源管理器的方式不同,获取资源管理器后,再调用resourceMgr.getRawFileContent()获取资源文件的ArrayBuffer。 ```ts - const fileData : void = await resourceMgr.getRawFileContent('test.jpg'); + const fileData : Uint8Array = await resourceMgr.getRawFileContent('test.jpg'); // 获取图片的ArrayBuffer const buffer = fileData.buffer; ``` @@ -100,11 +100,7 @@ 4. 设置解码参数DecodingOptions,解码获取PixelMap图片对象。 ```ts - class DecodingOption { - editable : boolean = true - desiredPixelFormat : number = 0 - } - let decodingOptions : DecodingOption = { + let decodingOptions : image.DecodingOptions = { editable: true, desiredPixelFormat: 3, } @@ -132,7 +128,7 @@ 2. 获取rawfile文件夹下test.jpg的ArrayBuffer。 ```ts - const fileData : void = await resourceMgr.getRawFileContent('test.jpg'); + const fileData : Uint8Array = await resourceMgr.getRawFileContent('test.jpg'); // 获取图片的ArrayBuffer const buffer = fileData.buffer; ``` diff --git a/zh-cn/application-dev/media/image-tool.md b/zh-cn/application-dev/media/image-tool.md index 8af27386508208e7ce35a304b2c0cef14e471811..4407bef007dc9fa21874d58aad221412ea5eaeff 100644 --- a/zh-cn/application-dev/media/image-tool.md +++ b/zh-cn/application-dev/media/image-tool.md @@ -27,7 +27,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe ```ts // 读取EXIF信息,BitsPerSample为每个像素比特数 - imageSource.getImageProperty('BitsPerSample', (error, data : GetImagePropertyOptions) => { + imageSource.getImageProperty('BitsPerSample', (error, data) => { if (error) { console.error('Failed to get the value of the specified attribute key of the image.And the error is: ' + error); } else { @@ -37,7 +37,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe // 编辑EXIF信息 imageSource.modifyImageProperty('ImageWidth', '120').then(() => { - const width : Promise = imageSource.getImageProperty("ImageWidth"); + const width : string = imageSource.getImageProperty("ImageWidth"); console.info('The new imageWidth is ' + width); }) ```