From d2bd8f75fc3a6d019bdc18eb146fcae801356fd4 Mon Sep 17 00:00:00 2001 From: zgf Date: Mon, 22 Jul 2024 14:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E9=87=87=E6=A0=B7?= =?UTF-8?q?=E5=92=8Chsp=E6=9C=AC=E5=9C=B0=E5=9B=BE=E6=A0=B7=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zgf --- entry/src/main/ets/pages/downsamplingPage.ets | 2 +- sharedlibrary/src/main/ets/pages/Index.ets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/pages/downsamplingPage.ets b/entry/src/main/ets/pages/downsamplingPage.ets index 7fea82e..3c33fef 100644 --- a/entry/src/main/ets/pages/downsamplingPage.ets +++ b/entry/src/main/ets/pages/downsamplingPage.ets @@ -355,7 +355,7 @@ struct Index { } Text('component用法') ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption }).width(200).height(200) - }.height(300).width('100%').backgroundColor(Color.Pink) + }.height("100%").width('100%').backgroundColor(Color.Pink) } } } diff --git a/sharedlibrary/src/main/ets/pages/Index.ets b/sharedlibrary/src/main/ets/pages/Index.ets index b34810d..d2b98af 100644 --- a/sharedlibrary/src/main/ets/pages/Index.ets +++ b/sharedlibrary/src/main/ets/pages/Index.ets @@ -54,7 +54,7 @@ struct Index { Button('点击加载本地文件').onClick(()=>{ getContext(this).createModuleContext('sharedlibrary').resourceManager.getMediaContent($r('app.media.setting').id).then((data:Uint8Array)=>{ - let ctx = ImageKnifeGlobal.getInstance().getHapContext() as common.UIAbilityContext; + let ctx = getContext(this).createModuleContext('sharedlibrary') as common.UIAbilityContext; let path = ctx.filesDir+"/set.jpeg"; FileUtils.getInstance().writeFile(path,data.buffer) FileUtils.getInstance().readFilePicAsync(path).then(buffer=>{