forked from floraachy/ImageKnife
修改下采样和hsp本地图样例
Signed-off-by: zgf <zenggaofeng2@h-partners.com>
This commit is contained in:
parent
659d28dd37
commit
d2bd8f75fc
|
@ -355,7 +355,7 @@ struct Index {
|
||||||
}
|
}
|
||||||
Text('component用法')
|
Text('component用法')
|
||||||
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption }).width(200).height(200)
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption }).width(200).height(200)
|
||||||
}.height(300).width('100%').backgroundColor(Color.Pink)
|
}.height("100%").width('100%').backgroundColor(Color.Pink)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct Index {
|
||||||
|
|
||||||
Button('点击加载本地文件').onClick(()=>{
|
Button('点击加载本地文件').onClick(()=>{
|
||||||
getContext(this).createModuleContext('sharedlibrary').resourceManager.getMediaContent($r('app.media.setting').id).then((data:Uint8Array)=>{
|
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";
|
let path = ctx.filesDir+"/set.jpeg";
|
||||||
FileUtils.getInstance().writeFile(path,data.buffer)
|
FileUtils.getInstance().writeFile(path,data.buffer)
|
||||||
FileUtils.getInstance().readFilePicAsync(path).then(buffer=>{
|
FileUtils.getInstance().readFilePicAsync(path).then(buffer=>{
|
||||||
|
|
Loading…
Reference in New Issue