【问题标题】:Transforming an ellipse in svg在 svg 中变换椭圆
【发布时间】:2019-03-03 13:33:45
【问题描述】:

我目前正在使用 svg 进行作业编程,但我似乎无法正确处理。所以我想要一个椭圆,让椭圆变得越来越小,而不是在 cx 或 cy 中,而是在 ry 中。我的问题是我怎么能做到这一点。因为当我尝试使用转换工具时,它不起作用。正如您在下面的 sn-p 中看到的,我添加了第三个值。当我这样做时,它停止工作,但我不知道如何使它工作。 this is an illustration to show what i want to achieve

编辑:我找到了让它工作的方法! (我已经发布了答案)

<ellipse id="experi2" cx="610" cy="330" rx="600" ry="250" style= "fill: #404040; stroke:black; stroke-width:10" filter="url(#blurryedge)" />


<animateTransform
 xlink:href="#experi2"
attributeName="transform"
type="translate"
from="610 330 250" <!-- when i added the third value it stopped working --> 
to=" 610 330 20"
begin="0s"
dur="2s"
Repeatcount="freeze"
/> 

【问题讨论】:

    标签: html animation svg transform ellipse


    【解决方案1】:

    你需要把属性名改成'ry'


    如何让它工作:

    <svg height="140" width="500">
    
    <ellipse  cx="200" cy="80" rx="100" ry="50" style= "fill: pink; stroke:black; stroke-width:5"  >
    <animate attributeName="ry" begin="0s" dur="4s" repeatCount="freeze" from="35%" to="0.1%"/>
    </ellipse>
    <!-- you just change the attributeName -->
    
    </svg>
    (如果您碰巧对此有任何疑问,请随时问他们)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-11
      • 1970-01-01
      • 2010-12-20
      • 2015-08-06
      • 2017-12-19
      • 1970-01-01
      • 2014-09-04
      相关资源
      最近更新 更多