svg规范关于transform属性的说明

SVG中的transform属性用于坐标变换,它定义了一个变换列表,按照顺序应用。在处理坐标和长度值之前,首先应用transform属性。例如,<rect>元素的x, y, width, height会在transform属性导致的坐标缩放2倍后被处理,所有属性值都在新的用户坐标系统中计算。" 134610946,16147475,PyYAML详解:Python解析和生成YAML的利器,"['Python', '开发语言', '数据解析', '数据生成']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在将svg图形格式转化为其它格式图形的工作中,坐标变换是首当其冲的一件工作,下面我们结合svg规范看看svg
是如何处理坐标变换的,理解了这些,再将其转化成你想要的图形格式的变换方式也就不困难了。
1.svg采用的初始坐标系统是视图坐标系,即屏幕左上角为左边原点,y轴正方向朝下,x轴正方向朝右

2.The value of the transform attribute is a <transform-list>, which is defined as a list of transform  definitions, which are applied in the order provided.
  transform属性的值是一个变换列表,它们将根据在svg文件中的顺序依次起作用。

  解析transform值时,一定要根据各个变换出现的顺序进行处理,而不能根据变换的类型进行处理。 

3.The transform attribute is applied to an element before processing any other coordinate or length values supplied for that element. In the element
  <rect x="10" y="10" width="20" height="20" transform="scale(2)"/>
  the x, y, width and height values are processed after the current coordinate system has been scaled uniformly by a factor of 2 by the transform attribute.

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值