-1
      <PathFigure StartPoint="0,0">
          <LineSegment Point="0,100"></LineSegment>
          <LineSegment Point="100,100"></LineSegment>
    </PathFigure>

I dont understand how does the above xaml output display? Can anyone explain what happens for the above code?

sly_Chandan
  • 3,437
  • 12
  • 54
  • 83

1 Answers1

2

Basically, it is like drawing on a graph paper

  • Put your pen down on point 0,0
  • move from 0,0 to 0,100
  • move from 0,100 to 100, 100

The only thing to note is that in WPF the y axis is inverted, so you get something like this:

enter image description here

  • The red line is your first move
  • The blue line is your second move
Justin Pihony
  • 66,056
  • 18
  • 147
  • 180
  • The polygon that u just mentioned is not the exact output. – sly_Chandan Jun 19 '13 at 17:25
  • @sly_Chandan I updated the answer. You are probably talking about the y-axis being inverted as to why you see it wrong – Justin Pihony Jun 19 '13 at 17:33
  • Perfect buddy.Now I get the proper output. My Question is why is the y axis inverted? – sly_Chandan Jun 19 '13 at 17:34
  • I believe this is legacy from winforms treating grids with 0,0 in the top left, but am not certain....talk to Microsoft :p. If you want, you can invert it back: http://stackoverflow.com/questions/1185948/how-to-change-x-y-origin-of-canvas-to-bottom-left-and-flip-the-y-coordinates – Justin Pihony Jun 19 '13 at 17:38