在将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. Attributes x, y, width and height (and any other attributes or properties) are treated as va

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

被折叠的 条评论
为什么被折叠?



