Pre Merge pull request !462 from 聪小陈/N/A
This commit is contained in:
commit
d1b57f7c1d
49
README_zh.md
49
README_zh.md
|
@ -62,7 +62,7 @@ await ImageKnife.getInstance().initFileCache(context, 256, 256 * 1024 * 1024)
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({
|
ImageKnifeComponent({
|
||||||
ImageKnifeOption: {
|
imageKnifeOption: {
|
||||||
loadSrc: $r("app.media.app_icon"),
|
loadSrc: $r("app.media.app_icon"),
|
||||||
placeholderSrc: $r("app.media.loading"),
|
placeholderSrc: $r("app.media.loading"),
|
||||||
errorholderSrc: $r("app.media.app_icon"),
|
errorholderSrc: $r("app.media.app_icon"),
|
||||||
|
@ -75,7 +75,7 @@ ImageKnifeComponent({
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({
|
ImageKnifeComponent({
|
||||||
ImageKnifeOption: {
|
imageKnifeOption: {
|
||||||
loadSrc: this.localFile,
|
loadSrc: this.localFile,
|
||||||
placeholderSrc: $r("app.media.loading"),
|
placeholderSrc: $r("app.media.loading"),
|
||||||
errorholderSrc: $r("app.media.app_icon"),
|
errorholderSrc: $r("app.media.app_icon"),
|
||||||
|
@ -88,7 +88,7 @@ ImageKnifeComponent({
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({
|
ImageKnifeComponent({
|
||||||
ImageKnifeOption: {
|
imageKnifeOption: {
|
||||||
loadSrc:"https://www.openharmony.cn/_nuxt/img/logo.dcf95b3.png",
|
loadSrc:"https://www.openharmony.cn/_nuxt/img/logo.dcf95b3.png",
|
||||||
placeholderSrc: $r("app.media.loading"),
|
placeholderSrc: $r("app.media.loading"),
|
||||||
errorholderSrc: $r("app.media.app_icon"),
|
errorholderSrc: $r("app.media.app_icon"),
|
||||||
|
@ -101,7 +101,7 @@ ImageKnifeComponent({
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({
|
ImageKnifeComponent({
|
||||||
ImageKnifeOption: {
|
imageKnifeOption: {
|
||||||
loadSrc: "https://file.atomgit.com/uploads/user/1704857786989_8994.jpeg",
|
loadSrc: "https://file.atomgit.com/uploads/user/1704857786989_8994.jpeg",
|
||||||
placeholderSrc: $r("app.media.loading"),
|
placeholderSrc: $r("app.media.loading"),
|
||||||
errorholderSrc: $r("app.media.app_icon"),
|
errorholderSrc: $r("app.media.app_icon"),
|
||||||
|
@ -123,7 +123,7 @@ async function custom(context: Context, src: string | PixelMap | Resource): Prom
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({
|
ImageKnifeComponent({
|
||||||
ImageKnifeOption: {
|
imageKnifeOption: {
|
||||||
loadSrc:"https://www.openharmony.cn/_nuxt/img/logo.dcf95b3.png",
|
loadSrc:"https://www.openharmony.cn/_nuxt/img/logo.dcf95b3.png",
|
||||||
progressListener:(progress:number)=>{console.info("ImageKinfe:: call back progress = " + progress)}
|
progressListener:(progress:number)=>{console.info("ImageKinfe:: call back progress = " + progress)}
|
||||||
}
|
}
|
||||||
|
@ -133,8 +133,8 @@ ImageKnifeComponent({
|
||||||
#### 6.支持option传入border,设置边框,圆角
|
#### 6.支持option传入border,设置边框,圆角
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption:
|
ImageKnifeComponent({
|
||||||
{
|
imageKnifeOption: {
|
||||||
loadSrc: $r("app.media.rabbit"),
|
loadSrc: $r("app.media.rabbit"),
|
||||||
border: {radius:50}
|
border: {radius:50}
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,8 @@ ImageKnifeComponent({ ImageKnifeOption:
|
||||||
#### 7.支持option图片变换
|
#### 7.支持option图片变换
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption:
|
ImageKnifeComponent({
|
||||||
{
|
imageKnifeOption: {
|
||||||
loadSrc: $r("app.media.rabbit"),
|
loadSrc: $r("app.media.rabbit"),
|
||||||
border: {radius:50},
|
border: {radius:50},
|
||||||
transformation: new BlurTransformation(3)
|
transformation: new BlurTransformation(3)
|
||||||
|
@ -177,12 +177,12 @@ ImageKnifeComponent({
|
||||||
圆形裁剪变换示例
|
圆形裁剪变换示例
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption:
|
ImageKnifeComponent({
|
||||||
{
|
imageKnifeOption: {
|
||||||
loadSrc: $r('app.media.pngSample'),
|
loadSrc: $r('app.media.pngSample'),
|
||||||
objectFit: ImageFit.Cover,
|
objectFit: ImageFit.Cover,
|
||||||
border: { radius: 150 }
|
border: { radius: 150 }
|
||||||
}
|
}
|
||||||
}).width(300)
|
}).width(300)
|
||||||
.height(300)
|
.height(300)
|
||||||
```
|
```
|
||||||
|
@ -190,12 +190,12 @@ ImageKnifeComponent({ ImageKnifeOption:
|
||||||
圆形裁剪带边框变换示例
|
圆形裁剪带边框变换示例
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption:
|
ImageKnifeComponent({
|
||||||
{
|
imageKnifeOption: {
|
||||||
loadSrc: $r('app.media.pngSample'),
|
loadSrc: $r('app.media.pngSample'),
|
||||||
objectFit: ImageFit.Cover,
|
objectFit: ImageFit.Cover,
|
||||||
border: { radius: 150, color: Color.Red, width: 5 }
|
border: { radius: 150, color: Color.Red, width: 5 }
|
||||||
}
|
}
|
||||||
}).width(300)
|
}).width(300)
|
||||||
.height(300)
|
.height(300)
|
||||||
```
|
```
|
||||||
|
@ -228,8 +228,8 @@ ImageKnifeComponent({
|
||||||
#### 8.监听图片加载成功与失败
|
#### 8.监听图片加载成功与失败
|
||||||
|
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption:
|
ImageKnifeComponent({
|
||||||
{
|
imageKnifeOption: {
|
||||||
loadSrc: $r("app.media.rabbit"),
|
loadSrc: $r("app.media.rabbit"),
|
||||||
onLoadListener:{
|
onLoadListener:{
|
||||||
onLoadStart:()=>{
|
onLoadStart:()=>{
|
||||||
|
@ -257,8 +257,9 @@ ImageKnifeComponent({
|
||||||
imageKnifeOption:{
|
imageKnifeOption:{
|
||||||
loadSrc:$r("app.media.pngSample"),
|
loadSrc:$r("app.media.pngSample"),
|
||||||
placeholderSrc:$r("app.media.loading")
|
placeholderSrc:$r("app.media.loading")
|
||||||
},syncLoad:true
|
},
|
||||||
})
|
syncLoad:true
|
||||||
|
})
|
||||||
```
|
```
|
||||||
#### 10.ImageKnifeAnimatorComponent 示例
|
#### 10.ImageKnifeAnimatorComponent 示例
|
||||||
```
|
```
|
||||||
|
@ -267,13 +268,15 @@ ImageKnifeAnimatorComponent({
|
||||||
loadSrc:"https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658",
|
loadSrc:"https://gd-hbimg.huaban.com/e0a25a7cab0d7c2431978726971d61720732728a315ae-57EskW_fw658",
|
||||||
placeholderSrc:$r('app.media.loading'),
|
placeholderSrc:$r('app.media.loading'),
|
||||||
errorholderSrc:$r('app.media.failed')
|
errorholderSrc:$r('app.media.failed')
|
||||||
},animatorOption:this.animatorOption
|
},
|
||||||
}).width(300).height(300).backgroundColor(Color.Orange).margin({top:30})
|
animatorOption:this.animatorOption
|
||||||
|
}).width(300).height(300).backgroundColor(Color.Orange).margin({top:30})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 11.加载图片回调信息数据 示例
|
#### 11.加载图片回调信息数据 示例
|
||||||
```
|
```
|
||||||
ImageKnifeComponent({ ImageKnifeOption: = {
|
ImageKnifeComponent({
|
||||||
|
imageKnifeOption: {
|
||||||
loadSrc: $r('app.media.pngSample'),
|
loadSrc: $r('app.media.pngSample'),
|
||||||
objectFit: ImageFit.Contain,
|
objectFit: ImageFit.Contain,
|
||||||
onLoadListener: {
|
onLoadListener: {
|
||||||
|
@ -308,7 +311,7 @@ ImageKnifeComponent({
|
||||||
errorholderSrc:$r('app.media.failed'),
|
errorholderSrc:$r('app.media.failed'),
|
||||||
downsampleOf: DownsampleStrategy.NONE
|
downsampleOf: DownsampleStrategy.NONE
|
||||||
}
|
}
|
||||||
}).width(300).height(300)
|
}).width(300).height(300)
|
||||||
```
|
```
|
||||||
#### 13.rcp自定义网络请求
|
#### 13.rcp自定义网络请求
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue