19

I am looking at an in-house Silverlight control to make some changes to it and I see something like;

 <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?

Chris W.
  • 22,835
  • 3
  • 60
  • 94

2 Answers2

31

That's called the Path Markup Syntax and it's used to define the shape of a Path.

  • M represents the Move command, which moves the "current location" to the specified point in X,Y.
  • L represents the Line command, which draws a line from the current location to the specified point in X,Y.

You can type it manually, though it is recommended that you use a Vector graphics capable editor, such as Expression Blend.

Federico Berasategui
  • 43,562
  • 11
  • 100
  • 154
  • so in my case, the control is a radio button and you know that little circle inside a radio button that shows up when we "Select" a radio button? Do you think this is responsible for drawing that? –  Mar 17 '14 at 19:10
  • 1
    Generally it's just an `Ellipse` inside the control template that becomes visible on the IsChecked=True state invoked by the VisualStateManager, nothing to complex. – Chris W. Mar 17 '14 at 19:12
4

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.

Felice Pollano
  • 32,832
  • 9
  • 75
  • 115