From 0f13dc2d8eab8441fe895ee67f801484596d16a5 Mon Sep 17 00:00:00 2001 From: 18829029633 <18829029633@163.com> Date: Wed, 10 Apr 2024 16:19:35 +0800 Subject: [PATCH] =?UTF-8?q?imageKnife=E6=94=AF=E6=8C=81heic=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 18829029633 <18829029633@163.com> --- entry/src/main/ets/pages/index.ets | 17 +++++++++++++++++ .../pages/testImageKnifeOptionChangedPage.ets | 10 ---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/entry/src/main/ets/pages/index.ets b/entry/src/main/ets/pages/index.ets index a36d77a..257f781 100644 --- a/entry/src/main/ets/pages/index.ets +++ b/entry/src/main/ets/pages/index.ets @@ -44,6 +44,14 @@ struct IndexFunctionDemo { errorholderSrc: $r('app.media.icon_failed'), 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() { Scroll() { @@ -84,6 +92,15 @@ struct IndexFunctionDemo { router.pushUrl({ url: "pages/imageknifeTestCaseIndex" }); }).margin({ top: 15 }) }.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%') diff --git a/entry/src/main/ets/pages/testImageKnifeOptionChangedPage.ets b/entry/src/main/ets/pages/testImageKnifeOptionChangedPage.ets index 9cef6c4..dc95841 100644 --- a/entry/src/main/ets/pages/testImageKnifeOptionChangedPage.ets +++ b/entry/src/main/ets/pages/testImageKnifeOptionChangedPage.ets @@ -37,16 +37,6 @@ struct TestImageKnifeOptionChangedPage { build() { Scroll() { 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}){ Button('本地jpg') .onClick(()=>{