1.update ImageKnife Project Config Files

Signed-off-by: zhoulisheng <635547767@qq.com>
This commit is contained in:
zhoulisheng 2022-07-14 23:14:51 -07:00
parent 560adc4574
commit 42af96cfd1
4 changed files with 106 additions and 114 deletions

View File

@ -13,7 +13,7 @@
- 推荐使用ImageKnifeComponent组件配合ImageKnifeOption参数来实现功能。 - 推荐使用ImageKnifeComponent组件配合ImageKnifeOption参数来实现功能。
- 支持用户自定义配置实现能力参考ImageKnifeComponent组件中对于入参ImageKnifeOption的处理。 - 支持用户自定义配置实现能力参考ImageKnifeComponent组件中对于入参ImageKnifeOption的处理。
<img src="screenshot/g3.gif" width="100%"/> <img src="C:\Users\Administrator\Desktop\screenshot\g3.gif" width="100%"/>
## 下载安装 ## 下载安装
@ -25,24 +25,21 @@ OpenHarmony npm环境配置等更多内容参考安装教程 [如何安装Ope
## 使用说明 ## 使用说明
1.首先初始化全局ImageKnife实例app.ets中调用ImageKnife.with()进行初始化。 1.首先初始化全局ImageKnife实例AbilityStage.ts中调用ImageKnife.with(this.context)进行初始化
```typescript ```typescript
import AbilityStage from "@ohos.application.AbilityStage"
import {ImageKnife} from '@ohos/imageknife' import {ImageKnife} from '@ohos/imageknife'
export default {
data: { export default class MyAbilityStage extends AbilityStage {
imageKnife: {} // ImageKnife全局占位符
},
onCreate() { onCreate() {
this.data.imageKnife = ImageKnife.with();// ImageKnife占位符全局初始化赋值 globalThis.ImageKnife = ImageKnife.with(this.context);
} }
} }
``` ```
2.参考[推荐使用](###'推荐使用')或[自定义实现](###'自定义实现') 2.参考[推荐使用](###'推荐使用')或[自定义实现](###'自定义实现')
#### 推荐使用: #### 推荐使用:
使用ImageKnifeOption作为入参配合自定义组件ImageKnifeComponent使用。 使用ImageKnifeOption作为入参配合自定义组件ImageKnifeComponent使用。
@ -212,10 +209,12 @@ let requestOptin = new RequestOption();
| request.roundedCorners() | RoundedCornersTransformation | 圆角剪裁 | | request.roundedCorners() | RoundedCornersTransformation | 圆角剪裁 |
| request.sepiaFilter() | SepiaFilterTransformation | 乌墨色滤波器 | | request.sepiaFilter() | SepiaFilterTransformation | 乌墨色滤波器 |
| request.sketchFilter() | SketchFilterTransformation | 素描滤波器 | | request.sketchFilter() | SketchFilterTransformation | 素描滤波器 |
| request.mask() | MaskTransformation | 遮罩 |
| request.swirlFilter() | SwirlFilterTransformation | 扭曲滤波器 |
## 兼容性 ## 兼容性
支持 OpenHarmony API version 8 及以上版本。 支持 OpenHarmony API version 9 及以上版本。
## 目录结构 ## 目录结构
@ -261,6 +260,8 @@ let requestOptin = new RequestOption();
- basicTestMediaImage.ets # 测试媒体image - basicTestMediaImage.ets # 测试媒体image
- basicTestResourceManagerPage.ets # 测试本地资源解析 - basicTestResourceManagerPage.ets # 测试本地资源解析
- compressPage.ets # 压缩页面 - compressPage.ets # 压缩页面
- cropImagePage.ets # 裁剪页面
- cropImagePage2.ets # 手势裁剪页面
- frescoImageTestCasePage.ets # 测试属性动画组件切换 - frescoImageTestCasePage.ets # 测试属性动画组件切换
- frescoLayerTestCasePage.ets # 测试ImageKnifeComponent组件切换配合属性动画 - frescoLayerTestCasePage.ets # 测试ImageKnifeComponent组件切换配合属性动画
- frescoRetryTestCasePage.ets # 测试ImageKnifeComponent加载失败重试 - frescoRetryTestCasePage.ets # 测试ImageKnifeComponent加载失败重试

View File

@ -1,21 +1,7 @@
{ {
"app": { "app": {
"signingConfigs": [ "compileSdkVersion": 9,
{ "compatibleSdkVersion": 9,
"name": "default",
"material": {
"certpath": "C:\\Users\\zwx1045834\\.ohos\\config\\openharmony\\auto_ohos.cer",
"storePassword": "000000184CD86AF7B78D3E3B6C36B9221705137AC28BD8A341A757477E5DC27D95E6A0DFD5EB51AE",
"keyAlias": "debugKey",
"keyPassword": "00000018DAB1AB9C9DF6E7C4D35BE8EAF4323EFA49131AB39C65BA5C44DE6D3879C6B31AA70D1E14",
"profile": "C:\\Users\\zwx1045834\\.ohos\\config\\openharmony\\auto_ohos_default_com.example.imageknifegiteepro.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "C:\\Users\\zwx1045834\\.ohos\\config\\openharmony\\auto_ohos.p12"
}
}
],
"compileSdkVersion": 8,
"compatibleSdkVersion": 8,
"products": [ "products": [
{ {
"name": "default", "name": "default",
@ -39,6 +25,10 @@
{ {
"name": "imageknife", "name": "imageknife",
"srcPath": "./imageknife" "srcPath": "./imageknife"
},
{
"name": "disklrucache",
"srcPath": "./disklrucache"
} }
] ]
} }

View File

@ -1,2 +1,2 @@
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks module.exports = require('@ohos/hvigor-ohos-plugin').appTasks

View File

@ -1,7 +1,7 @@
{ {
"license":"ISC", "license":"ISC",
"devDependencies":{}, "devDependencies":{},
"name": "imageknifegiteepro", "name":"imageknife",
"ohos":{ "ohos":{
"org":"huawei", "org":"huawei",
"directoryLevel":"project", "directoryLevel":"project",
@ -11,8 +11,9 @@
"repository":{}, "repository":{},
"version":"1.0.0", "version":"1.0.0",
"dependencies":{ "dependencies":{
"@ohos/hvigor-ohos-plugin": "1.0.6", "@ohos/hypium":"1.0.1",
"@ohos/hvigor-ohos-plugin":"1.1.6",
"hypium":"^1.0.0", "hypium":"^1.0.0",
"@ohos/hvigor": "1.0.6" "@ohos/hvigor":"1.1.6"
} }
} }