Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mystery of Points in XAML

enter image description here

I am trying to create a polygon using points in xaml and as per my understanding the output with the given points should be the triangle with black fill, but it return the triangle with pink fill. I am not getting how this is happening. Kindly let me know.

Tha xaml for this is

  <Polygon Width="237"
             Height="214"
             Fill="White"
             Stroke="Black"
             StrokeThickness="2">
        <Polygon.Points>
            <Point X="50" Y="50" />
            <Point X="150" Y="150" />
            <Point X="50" Y="150" />

        </Polygon.Points>
    </Polygon>
like image 516
manav inder Avatar asked Mar 27 '12 12:03

manav inder


1 Answers

The Point X=0 and Y=0 is in the upper left corner, not in the lower left corner. So the drawing is correct.

To get what you want is to change your xaml as follows:

<Polygon Width="237"
         Height="214"
         Fill="Black"
         Stroke="White"
         StrokeThickness="2">
    <Polygon.Points>
        <Point X="50" Y="150" />
        <Point X="150" Y="150" />
        <Point X="150" Y="50" />

    </Polygon.Points>
<Polygon>
like image 91
Jehof Avatar answered Oct 06 '22 00:10

Jehof