小编Clo*_*ing的帖子

如何将不同的背景图像 (.png) 添加到 SVG 圆形,并设置笔画?

我已经看到将 背景图像 (.png) 添加到 SVG 圆形

但就我而言,我需要在不同的图像形状中添加笔画和笔画宽度

这是我的代码:

<svg width="700" height="660">   
<defs>
    <pattern id="image" x="0" y="0" patternUnits="userSpaceOnUse" height="1" width="1">
      <image x="0" y="0" xlink:href="url.png"></image>
    </pattern>   
    <pattern id="image2" x="0" y="0" patternUnits="userSpaceOnUse" height="1" width="1">
      <image x="0" y="0" xlink:href="url2.png"></image>
    </pattern>   
</defs>   
 <circle cx = "20%" cy = "20%" r = "20" fill = "url(#image)"  stroke-width ="2px" stroke="red"/> 
 <circle cx = "40%" cy = "20%" r = "20" fill = "url(#image2)"  stroke-width ="2px" stroke="red"/>
</svg>
Run Code Online (Sandbox Code Playgroud)

这行不通,第二个圆圈没有填充图像

和这个:

<svg width="700" height="660">
    <filter id="this_image" x="0%" y="0%" width="100%" …
Run Code Online (Sandbox Code Playgroud)

html javascript css svg

1
推荐指数
1
解决办法
994
查看次数

标签 统计

css ×1

html ×1

javascript ×1

svg ×1