svg放大缩小图片

svg放大缩小图片

<g transform="scale(1 1)"><animateTransform attributeName="transform" type="scale" values="1;1;1;1.2;1;1;1" dur="1.2s" repeatCount="indefinite"></animateTransform><foreignObject x="-172" y="-120" width="390" height="240"><svg powered-by="yutustudio666" style="display: inline-block;background-image: url(&quot;https://mmbiz.qpic.cn/mmbiz_png/y2JPACSibbibEuLpF1rBn6ZAGesgCjXxUIngYuGMicgzsnnZDn9XxPrhZImYQFcdh3Yh6kTRLywL3kP8YnYqvAlrA/640?wx_fmt=png&quot;);background-repeat: no-repeat;background-size: 100% 100%;" viewBox="0 0 390 240"></svg></foreignObject></g>

 

 

默认是左上角中心点 需要里面forergnobjet位移一下 -图片宽度/2 -图片高度/2

posted @ 2021-09-08 15:45  newmiracle宇宙  阅读(382)  评论(0编辑  收藏  举报