Pre Merge pull request !343 from zgf/master

This commit is contained in:
zgf 2024-07-22 06:42:29 +00:00 committed by Gitee
commit fb342ad064
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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=>{