如何正确设置 svg 和图像比例?

问题描述

有一个 svg,其中 rect 由图案填充,里面有图像。我应该怎么做才能从四面八方剪切 5-10 像素的图像?

这就是我需要的:

enter image description here

现在我所拥有的:

<pattern id="pattern" width="100%" height="100%">
        <image :href="layoutImage.source" :width="layoutWidth" :height="layoutHeight"></image>
</pattern>

<rect :width="layoutWidth" :height="layoutHeight" fill="url(#pattern)"></rect>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)