Pre Merge pull request !258 from taxuexunji/master
This commit is contained in:
commit
bf33575c5b
|
@ -1,5 +1,6 @@
|
|||
## 2.2.0-rc.3
|
||||
- 修复错误图绘制完后变成占位图
|
||||
- 修改webp的demo
|
||||
|
||||
## 2.2.0-rc.2
|
||||
- ImageKnife支持下采样
|
||||
|
|
|
@ -20,8 +20,17 @@ import { ImageKnifeOption,ScaleType } from '@ohos/libraryimageknife'
|
|||
struct webpImageTestPage {
|
||||
@State message: string = 'webp图片'
|
||||
@State options: ImageKnifeOption = {
|
||||
loadSrc: $r('app.media.app_icon')
|
||||
loadSrc: $r('app.media.webpSample'),
|
||||
placeholderSrc:$r('app.media.icon_loading'),
|
||||
mainScaleType:ScaleType.FIT_XY
|
||||
}
|
||||
@State options1: ImageKnifeOption = {
|
||||
loadSrc: $r('app.media.webpAtanta'),
|
||||
placeholderSrc:$r('app.media.icon_loading'),
|
||||
mainScaleType:ScaleType.FIT_XY
|
||||
}
|
||||
@State flag: boolean = false
|
||||
@State flag1: boolean = false
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
|
@ -35,33 +44,32 @@ struct webpImageTestPage {
|
|||
Button("加载单帧webp")
|
||||
.margin(16)
|
||||
.onClick(() => {
|
||||
console.log("加载单帧webp")
|
||||
this.options = {
|
||||
loadSrc: $r('app.media.webpSample'),
|
||||
placeholderSrc:$r('app.media.icon_loading'),
|
||||
mainScaleType:ScaleType.FIT_XY
|
||||
}
|
||||
this.flag = !this.flag
|
||||
})
|
||||
if(this.flag) {
|
||||
ImageKnifeComponent({ imageKnifeOption: this.options })
|
||||
.margin(16)
|
||||
.width(200)
|
||||
.height(100)
|
||||
.clip(true)
|
||||
.borderRadius(50)
|
||||
}
|
||||
Button("加载多帧webp")
|
||||
.margin(16)
|
||||
.onClick(() => {
|
||||
console.log("加载多帧webp")
|
||||
this.options = {
|
||||
loadSrc: $r('app.media.webpAtanta'),
|
||||
placeholderSrc:$r('app.media.icon_loading'),
|
||||
mainScaleType:ScaleType.FIT_XY
|
||||
}
|
||||
this.flag1 = !this.flag1
|
||||
})
|
||||
ImageKnifeComponent({ imageKnifeOption: this.options })
|
||||
.margin(16)
|
||||
.width(200)
|
||||
.height(100)
|
||||
.clip(true)
|
||||
.borderRadius(50)
|
||||
if(this.flag1) {
|
||||
ImageKnifeComponent({ imageKnifeOption: this.options1 })
|
||||
.margin(16)
|
||||
.width(200)
|
||||
.height(100)
|
||||
.clip(true)
|
||||
.borderRadius(50)
|
||||
}
|
||||
}
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
.justifyContent(FlexAlign.Center)
|
||||
}
|
||||
.width("100%")
|
||||
.height("100%")
|
||||
|
|
|
@ -270,7 +270,6 @@ export struct ImageKnifeComponent {
|
|||
for (let i = 0; i < this.imageKnifeOption.headerOption.length; i++) {
|
||||
let headerOptions = this.imageKnifeOption.headerOption[i];
|
||||
request.addHeader(headerOptions.key, headerOptions.value);
|
||||
request.signature = new ObjectKey(new Date().getTime().toString())
|
||||
}
|
||||
}
|
||||
if( this.imageKnifeOption.priority != undefined) {
|
||||
|
|
Loading…
Reference in New Issue