【发布时间】:2012-07-18 06:41:31
【问题描述】:
可能重复:
How to get the actual x/y position of an element in SVG with transformations and matrices
我需要获取在 SVG 中这样编写的元素的 x/y 位置:
<image
y="-421.28461"
x="335.27295"
id="image2991"
xlink:href="file:///C:/Users/tom/Documents/t.jpg"
height="369"
width="360"
transform="matrix(0.22297057,0.97482518,-0.97482518,0.22297057,0,0)" />
这里给出了x 和y 属性,但这并没有给出图像的实际位置。据我所知
变换矩阵 [a,b,c,d,e,f] e & f 分别给出 x 和 y 的平移轴。但是
问题是这里两个( e & f ) 都是0。现在我可以得到这个图像的实际x 任何y 吗?
【问题讨论】:
-
都写完了。
x="335.27295"y="-421.28461" -
但这不是元素的实际 x 和 y
-
参见 SVG 文档中的 image element
-
哦,您是在寻找应用变换矩阵后的 x、y 吗?
-
好的,我会为你计算并发布一个带有解释的答案,给我几分钟..
标签: c# math matrix svg transform