How to draw a smooth curved line in WPF? How to draw a smooth curved line in WPF? wpf wpf

How to draw a smooth curved line in WPF?


I think you are looking for splines

http://msdn.microsoft.com/en-us/library/554h284b.aspx

Gabe is correct that is from Forms

Under WPF you could try a PolyBezierSegment but it require 4 points. Possible you could put in three points and 1 more to shape it.

<Canvas>    <Path Stroke="Black" StrokeThickness="10">        <Path.Data>            <PathGeometry>                <PathGeometry.Figures>                    <PathFigureCollection>                            <PathFigure StartPoint="100,80">                            <PathFigure.Segments>                                <PathSegmentCollection>                                    <PolyBezierSegment Points="90,200 140,200 160,200 180,200 430,190 430,280" />                                </PathSegmentCollection>                            </PathFigure.Segments>                        </PathFigure>                    </PathFigureCollection>                </PathGeometry.Figures>            </PathGeometry>        </Path.Data>    </Path></Canvas>

This results in the following curve

enter image description here