imageKnife支持heic格式图片
Signed-off-by: 18829029633 <18829029633@163.com>
This commit is contained in:
parent
6bf0e6f511
commit
0f13dc2d8e
|
@ -44,6 +44,14 @@ struct IndexFunctionDemo {
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
headerOption: [this.headerOptions1]
|
headerOption: [this.headerOptions1]
|
||||||
};
|
};
|
||||||
|
@State imageKnifeOption3: ImageKnifeOption =
|
||||||
|
{
|
||||||
|
loadSrc: $r('app.media.yunHeic'),
|
||||||
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
};
|
||||||
|
|
||||||
|
@State flag: boolean = true;
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
|
@ -84,6 +92,15 @@ struct IndexFunctionDemo {
|
||||||
router.pushUrl({ url: "pages/imageknifeTestCaseIndex" });
|
router.pushUrl({ url: "pages/imageknifeTestCaseIndex" });
|
||||||
}).margin({ top: 15 })
|
}).margin({ top: 15 })
|
||||||
}.width('100%').height(60).backgroundColor(Color.Pink)
|
}.width('100%').height(60).backgroundColor(Color.Pink)
|
||||||
|
|
||||||
|
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
|
Button("heic图片测试")
|
||||||
|
.onClick(() => {
|
||||||
|
this.flag = !this.flag
|
||||||
|
}).margin({ top: 15 })
|
||||||
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption3 }).width(300).height(300)
|
||||||
|
.visibility(this.flag ? Visibility.Hidden : Visibility.Visible)
|
||||||
|
}.width('100%').height(60).backgroundColor(Color.Pink)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|
|
@ -37,16 +37,6 @@ struct TestImageKnifeOptionChangedPage {
|
||||||
build() {
|
build() {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
Flex({direction:FlexDirection.Row}){
|
|
||||||
Button('本地heic')
|
|
||||||
.onClick(()=>{
|
|
||||||
this.imageKnifeOption1 = {
|
|
||||||
loadSrc: $r('app.media.yunHeic'),
|
|
||||||
placeholderSrc: $r('app.media.icon_loading'),
|
|
||||||
errorholderSrc: $r('app.media.icon_failed'),
|
|
||||||
};
|
|
||||||
}).margin({left:5}).backgroundColor(Color.Blue)
|
|
||||||
}
|
|
||||||
Flex({direction:FlexDirection.Row}){
|
Flex({direction:FlexDirection.Row}){
|
||||||
Button('本地jpg')
|
Button('本地jpg')
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
|
|
Loading…
Reference in New Issue