Fill Polygon with RadialGradientBrush : Polygon « Windows Presentation Foundation « C# / CSharp Tutorial






<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>
WPF Fill Polygon With Radial Gradient Brush








24.89.Polygon
24.89.1.Polyline by PointsPolyline by Points
24.89.2.A Polygon always closes the end pointsA Polygon always closes the end points
24.89.3.Specifying points the long way with Polygon.Points tag and PointSpecifying points the long way with Polygon.Points tag and Point
24.89.4.Draw figure with 'EvenOdd' FillRuleDraw figure with 'EvenOdd' FillRule
24.89.5.Draw figure with 'NonZero' FillRuleDraw figure with 'NonZero' FillRule
24.89.6.Draw second figure with 'NonZero' FillRuleDraw second figure with 'NonZero' FillRule
24.89.7.Polygon Stretch= UniformToFillPolygon Stretch= UniformToFill
24.89.8.Polygon Stretch=UniformPolygon Stretch=Uniform
24.89.9.Star PolygonStar Polygon
24.89.10.Fill Polygon with RadialGradientBrushFill Polygon with RadialGradientBrush
24.89.11.Polygon with FillPolygon with Fill
24.89.12.Polygon Stroke color and ThicknessPolygon Stroke color and Thickness
24.89.13.Polygon Along with CanvasPolygon Along with Canvas
24.89.14.Polygon Stretch=FillPolygon Stretch=Fill
24.89.15.Polygon Stretch=NonePolygon Stretch=None
24.89.16.Star.xamlStar.xaml
24.89.17.Difference between EvenOdd FillRule and NonZero FillRuleDifference between EvenOdd FillRule and NonZero FillRule
24.89.18.Draws another triangle with a blue interior with PolygonDraws another triangle with a blue interior with Polygon
24.89.19.Non-zero fill rule with more complex shape with PolygonNon-zero fill rule with more complex shape with Polygon
24.89.20.Polygon Mouse down eventPolygon Mouse down event