Polygon


PolygonHierarchy: UIElement FrameworkElement Shape StretchableShape

Type: Shape

     <Polygon         Points="10,110 60,10 110,110"         Fill="Red"         FillRule="EvenOdd|NonZero" /> 

or:

     <Polygon        Fill="Red"        FillRule="EvenOdd|NonZero" >        <Polygon.Points>          <Point X="10" Y="110" />           <Point X="60" Y="10" />           <Point X="110" Y="110" />        </Polygon.Points>     </Polygon> 

<Polygon .../> draws a series of connected lines as a closed shape (Figure 9-11). If you do not specify a value for the Fill attribute, the shape will be filled with the default color, transparent.

Figure 9-11. Polygon


Attributes


FillRule (optional)

Describes the rule used to determine if a Point is inside the shape and should therefore be painted according to the Fill attribute value.


EvenOdd

After the Point is examined, a ray is drawn from it to infinity in any direction. If the number of path segments the ray crosses is even, the Point is outside the shape. If the number of path segments the ray crosses is odd, the Point is inside the shape and is painted according to the Fill attribute value.


NonZero

After the Point is examined, a ray is drawn from the point to infinity in any direction. Starting from zero, the count increases by one every time a path segment crosses the ray from left to right and decreases by one every time a path segment crosses the ray from right to left. If the resulting value is 0, then the Point is outside the shape; otherwise, it is inside the shape and will be painted accordingly.


Points (required)

A series of points describing the vertices of the Polygon. In XAML, Points can be described as a space-delimited list of comma-separated x- and y-coordinate pairs using inline markup or as a series of Point elements.




XAML in a Nutshell
XAML in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596526733
EAN: 2147483647
Year: 2007
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net