未验证 提交 c1f20a4b 编写于 作者: O openharmony_ci 提交者: Gitee

!23568 鸿蒙指南文档ArkTS适配

Merge pull request !23568 from zhongqihong/master
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
不同模型获取资源管理器的方式不同,获取资源管理器后,再调用resourceMgr.getRawFileContent()获取资源文件的ArrayBuffer。 不同模型获取资源管理器的方式不同,获取资源管理器后,再调用resourceMgr.getRawFileContent()获取资源文件的ArrayBuffer。
```ts ```ts
const fileData : void = await resourceMgr.getRawFileContent('test.jpg'); const fileData : Uint8Array = await resourceMgr.getRawFileContent('test.jpg');
// 获取图片的ArrayBuffer // 获取图片的ArrayBuffer
const buffer = fileData.buffer; const buffer = fileData.buffer;
``` ```
...@@ -100,11 +100,7 @@ ...@@ -100,11 +100,7 @@
4. 设置解码参数DecodingOptions,解码获取PixelMap图片对象。 4. 设置解码参数DecodingOptions,解码获取PixelMap图片对象。
```ts ```ts
class DecodingOption { let decodingOptions : image.DecodingOptions = {
editable : boolean = true
desiredPixelFormat : number = 0
}
let decodingOptions : DecodingOption = {
editable: true, editable: true,
desiredPixelFormat: 3, desiredPixelFormat: 3,
} }
...@@ -132,7 +128,7 @@ ...@@ -132,7 +128,7 @@
2. 获取rawfile文件夹下test.jpg的ArrayBuffer。 2. 获取rawfile文件夹下test.jpg的ArrayBuffer。
```ts ```ts
const fileData : void = await resourceMgr.getRawFileContent('test.jpg'); const fileData : Uint8Array = await resourceMgr.getRawFileContent('test.jpg');
// 获取图片的ArrayBuffer // 获取图片的ArrayBuffer
const buffer = fileData.buffer; const buffer = fileData.buffer;
``` ```
......
...@@ -27,7 +27,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe ...@@ -27,7 +27,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe
```ts ```ts
// 读取EXIF信息,BitsPerSample为每个像素比特数 // 读取EXIF信息,BitsPerSample为每个像素比特数
imageSource.getImageProperty('BitsPerSample', (error, data : GetImagePropertyOptions) => { imageSource.getImageProperty('BitsPerSample', (error, data) => {
if (error) { if (error) {
console.error('Failed to get the value of the specified attribute key of the image.And the error is: ' + error); console.error('Failed to get the value of the specified attribute key of the image.And the error is: ' + error);
} else { } else {
...@@ -37,7 +37,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe ...@@ -37,7 +37,7 @@ EXIF信息的读取与编辑相关API的详细介绍请参见[API参考](../refe
// 编辑EXIF信息 // 编辑EXIF信息
imageSource.modifyImageProperty('ImageWidth', '120').then(() => { imageSource.modifyImageProperty('ImageWidth', '120').then(() => {
const width : Promise<string> = imageSource.getImageProperty("ImageWidth"); const width : string = imageSource.getImageProperty("ImageWidth");
console.info('The new imageWidth is ' + width); console.info('The new imageWidth is ' + width);
}) })
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册