• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3734

entry/12-May-2024-1,114950

photomodify/12-May-2024-1,0911,013

screenshots/devices/12-May-2024-

.gitignoreD12-May-202479 66

README.mdD12-May-20242 KiB4020

README_zh.mdD12-May-20242.4 KiB4322

build-profile.json5D12-May-20241.1 KiB4645

hvigorfile.jsD12-May-2024168 21

package.jsonD12-May-2024375 1918

README.md

1# Image Processing
2
3### Introduction
4
5This sample demonstrates the image processing function.
6
7In this sample, [\<TextArea>](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md) is used to implement multi-line text input, [mediaLibrary](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-mediaquery.md) is used to obtain images from albums, [image](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) is used to generate pixel maps, and **scale()**, **crop()**, and **rotate()** of the **pixelMap** class are used to scale, crop, and rotate images.
8
9### Usage
10
111. Touch **Add image** on the offering review page. The page for selecting images is displayed.
12
132. Select the images to be displayed. You can select six images at most.
14
153. Select an image and touch **Next**. The image editing page is displayed. To scale an image, touch **scale** and then touch **narrow** or **amplification**. To crop the image, touch **crop** and select a crop ratio. To rotate the image, touch **rotate**.
16
174. After finishing editing the image, touch **OK**. The page for posting comments is displayed, with the images shown. You can touch **Add image** to add more images.
18
195. Touch the back button to exit the app.
20
21### Preview
22
23![](screenshots/devices/en/scale.png) ![](screenshots/devices/en/crop_choice.png) ![](screenshots/devices/en/rotate.png)
24
25### Required Permissions
26
27[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md), which allows an app to read media files from the user's external storage.
28
29### Dependency
30
31N/A
32
33### Constraints
34
351. This sample can only be run on standard-system devices that use the Rockchip RK3568 chip.
36
372. This sample is based on the stage model, which is supported from API version 9 (SDK version: 3.2.6.5).
38
393. DevEco Studio 3.0 Beta4 (Build version: 3.0.0.992, built on July 14, 2022) must be used.
40

README_zh.md

1# 图片处理
2
3### 介绍
4
5本示例展示图片编辑相关功能。
6
7本示例使用 [TextArea](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md) 实现多文本输入,使用 [mediaLibrary](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-mediaquery.md) 实现在相册中获取图片,使用 [image](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md) 生成pixelMap,使用pixelMap的scale(),crop(),rotate()接口实现对图片的缩放,裁剪,旋转功能。
8
9使用说明:
10
111.发表评价页面点击添加图片/照片,页面跳转到图片选择页面。
12
132.进入图片选择页面后,选择需要显示的图片,最多选择6张图片。
14
153.选中图片后点击下一步,页面会跳转到图片编辑页面,点击缩放,页面会显示缩小,放大按钮,点击按钮,可对图片进行缩小,放大操作。点击裁剪,页面会跳出裁剪比例,点击想要裁剪的比例可以对图片进行裁剪。点击旋转可对图片进行旋转。
16
174.图片编辑完成后,点击**确认**,页面会跳转到发表评价页面,显示相关照片。点击添加图片/照片可以对图片进行重新选择。
18
195.点击返回按钮,退出应用。
20
21### 效果预览
22
23![](screenshots/devices/zh/scale.png) ![](screenshots/devices/zh/crop_choice.png) ![](screenshots/devices/zh/rotate.png)
24
25### 相关权限
26
27允许应用读取用户外部存储中的媒体文件信息:[ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)
28
29允许应用读写用户外部存储中的媒体文件信息:[ohos.permission.WRITE_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)
30
31允许应用访问用户媒体文件中的地理位置信息:[ohos.permission.MEDIA_LOCATION](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)
32
33### 依赖
34
35不涉及。
36
37### 约束与限制
38
391.本示例仅支持标准系统上运行,支持设备:RK3568。
40
412.本示例为Stage模型,仅支持API9版本SDK,版本号:3.2.6.5。
42
433.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。