Mega Code Archive

 
Categories / C# / WPF
 

Path gradient and Bezier

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">     <Path Canvas.Left="150" Canvas.Top="150" StrokeThickness="25">         <Path.Stroke>             <LinearGradientBrush>                 <LinearGradientBrush.GradientStops>                     <GradientStop Offset="0.00" Color="Red" />                     <GradientStop Offset="0.84" Color="Red" />                     <GradientStop Offset="1.00" Color="Violet" />                 </LinearGradientBrush.GradientStops>             </LinearGradientBrush>         </Path.Stroke>         <Path.Data>             <PathGeometry>                 <PathGeometry.Figures>                     <PathFigure StartPoint="0 -100">                         <PolyBezierSegment                              Points=" -55 -100, -100  -55, -100    0,                                     -100   55,  -55  100,    0  100,                                      100  -50,   55 -100,    0 -100" />                     </PathFigure>                 </PathGeometry.Figures>             </PathGeometry>         </Path.Data>     </Path> </Canvas>