Fill Polygon with RadialGradientBrush


   
     
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.Samples.Graphics.RectangleExample"
    WindowTitle="Example">
  <Canvas>

        <Polygon Name="hexagon"
          Stroke="Blue"
          StrokeThickness="2.0"
          Points="16,130 302,13 304,249 76,322 493,249 495,103">
          <Polygon.Fill>
            <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
              <RadialGradientBrush.GradientStops>
                <GradientStop Color="Yellow" Offset="0" />
                <GradientStop Color="Gold" Offset="0.25" />
              </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
          </Polygon.Fill>
        </Polygon>
   
  </Canvas>
</Page>

   
    
    
    
    
     


Polygon Stretch=Fill


   
     
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.Samples.Graphics.RectangleExample"
    WindowTitle="Rectangle Example">
  <Canvas>
     <Polygon Height="100" Width="50" Points="0,0 10,10 0,10" Fill="Blue" Stretch="Fill"/>
  </Canvas>
</Page>

   
    
    
    
    
     


Polygon Stretch=None


   
     
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.Samples.Graphics.RectangleExample"
    WindowTitle="Rectangle Example">
  <Canvas>
    <Polygon Height="100" Width="50" Points="0,0 10,10 0,10" Fill="Blue" Stretch="None"/>
  </Canvas>
</Page>

   
    
    
    
    
     


Small ArcSegment


   
      
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      HorizontalAlignment="Stretch" VerticalAlignment="Stretch">


<Canvas>
  <Ellipse Fill="Cyan" Stroke="Black" Width="140" Height="60" />
  <Path Fill="Cyan" Stroke="Black" Canvas.Left="180">
    <Path.Data>
      <PathGeometry>

        <PathFigure StartPoint="280,1" IsClosed="True">
          <ArcSegment Point="330,51" Size="70,30"
                      SweepDirection="Clockwise" IsLargeArc="False" />
        </PathFigure>

      </PathGeometry>
    </Path.Data>
  </Path>
</Canvas>


</Page>