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("https://mmbiz.qpic.cn/mmbiz_png/y2JPACSibbibEuLpF1rBn6ZAGesgCjXxUIngYuGMicgzsnnZDn9XxPrhZImYQFcdh3Yh6kTRLywL3kP8YnYqvAlrA/640?wx_fmt=png");background-repeat: no-repeat;background-size: 100% 100%;" viewBox="0 0 390 240"></svg></foreignObject></g>
默认是左上角中心点 需要里面forergnobjet位移一下 -图片宽度/2 -图片高度/2
如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/