修改下采样和hsp本地图样例

Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
zgf 2024-07-22 14:41:15 +08:00
parent 659d28dd37
commit d2bd8f75fc
2 changed files with 2 additions and 2 deletions

View File

@ -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)
}
}
}

View File

@ -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=>{