替换svg图片

Signed-off-by: liuhaikang <893370936@qq.com>
This commit is contained in:
liuhaikang 2023-09-07 11:40:36 +08:00
parent d112c4cd33
commit 8fa84463ee
2 changed files with 19 additions and 1 deletions

View File

@ -27,7 +27,7 @@ struct svgTestCasePage {
Button("加载SVG图片") Button("加载SVG图片")
.onClick(()=>{ .onClick(()=>{
globalThis.ImageKnife.getImageKnifeContext().resourceManager.getMedia($r('app.media.svgSample').id) globalThis.ImageKnife.getImageKnifeContext().resourceManager.getMedia($r('app.media.iconsvg').id)
.then(data => { .then(data => {
console.log('basicTestFileIOPage - 本地加载资源 解析后数据data = ' + data) console.log('basicTestFileIOPage - 本地加载资源 解析后数据data = ' + data)
let svgImpl = new SVGParseImpl(); let svgImpl = new SVGParseImpl();

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
width="120"
height="120"
viewBox="0 0 120 120">
<g
fill="none"
fill-rule="evenodd">
<rect
width="120"
height="120"
fill="#EBF6FF"
rx="36"/>
<path
fill="#0D94FF"
d=""/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 385 B