wpf 什么是 M , L , XAML for Path Data 属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22463168/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is M , L , XAML for Path Data attribute
提问by Federico Berasategui
I am looking at an in-house Silverlight control to make some changes to it and I see something like;
我正在查看内部 Silverlight 控件以对其进行一些更改,我看到类似的内容;
<Path x:Name="SomeIcon" Data="M102.03442,598.79645 L105.22962,597.78918
...copied just a part of what was in the Data.
...只复制了数据中的一部分。
What are those? How did they know what to put there? Also, what do they affect?
那些是什么?他们怎么知道在那里放什么?另外,它们有什么影响?
回答by Federico Berasategui
That's called the Path Markup Syntaxand it's used to define the shape of a Path.
这称为路径标记语法,用于定义路径的形状。
Mrepresents theMovecommand, which moves the "current location" to the specified point in X,Y.Lrepresents theLinecommand, which draws a line from the current location to the specified point in X,Y.
M表示将Move“当前位置”移动到 X、Y 中指定点的命令。L表示Line命令,它从当前位置到 X,Y 中的指定点绘制一条线。
You can type it manually, though it is recommended that you use a Vector graphics capable editor, such as Expression Blend.
您可以手动键入它,但建议您使用具有矢量图形功能的编辑器,例如Expression Blend。
回答by Felice Pollano
M stays for "move" and L stays for "Line". Is a language to draw a geometry and it is called Stream geometry mini-language. As stated before, think like driving a plotter, M moves with the pen up, L down the pen and move with the pen down, very simple. A a little geometry knowledge is enough to create something interesting, even if some tools can help ypu, as Expression Blend.
M 代表“移动”,L 代表“线”。是一种绘制几何图形的语言,它被称为流几何迷你语言。如前所述,就像驾驶绘图仪一样,M 笔向上移动,L 笔向下移动,笔向下移动,非常简单。一点几何知识就足以创建一些有趣的东西,即使某些工具可以帮助您,例如 Expression Blend。

