目标:将svg矩形(写为路径)转换为xaml矩形并计算以下属性。
X,Y,RX,RY,高度,宽度
现在,对于给定的样本路径
<path d="M0 585.9 A9.42477 9.37886 -180 0 0 9.42 595.28 L141.37 595.28 A9.42477 9.37886 -180 0 0 150.79 585.9 L150.79 377.79 A9.42477 9.37886 -180 0 0 141.37 368.41 L9.42 368.41 A9.42477 9.37886 -180 0 0 0 377.79 L0 585.9 Z" class="st1" />
关于如何进行此计算的任何想法?
答案 0 :(得分:0)
我不是C#专家,也不是vectoral对话。我唯一的建议是:使用inscape脚本来转换为xaml。但是我所知道的xaml不支持svg的所有属性(exmp。非缩放中风)。
答案 1 :(得分:0)
我目前正在使用SVG
到xaml
转换器,因此这主要取决于我自己的试错经验。
您可以将d=
替换为Data=
并使用XamlReader
由于xaml
有Path
object(Shape)
,我建议您将SVG
Path
转换为xaml
Path
。< / p>
如果您选择这样做,请记住包括:
xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"
到字符串 - XamlReader必须阅读 - 包含您的xaml
代码
这样,您最终会得到Path
object(Shape)
。