QuadraticBezierSegment Class
Creates a quadratic Bezier curve between two points in a PathFigure.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Use a PathFigure object to create composite shapes using QuadraticBezierSegment objects and other segments.
The QuadraticBezierSegment class does not contain a property for the starting point of the line. The starting point of the line is the end point of the previous segment, or the StartPoint of the PathFigure if no other segments exist.
Freezable Features
Because QuadraticBezierSegment objects inherit from the Freezable class, they provide several special features: they can be declared as resources, shared among multiple objects, made read-only to improve performance, cloned, and made thread safe. For more information about the different features that are provided by Freezable objects, see Freezable Objects Overview.
This example shows how to create a quadratic Bezier curve. To create a quadratic Bezier curve, use the PathGeometry, PathFigure, and QuadraticBezierSegment classes.
In the following examples, a quadratic Bezier curve is drawn from (10,100) to (300,100). The curve has a control point of (200,200).
xamlIn Extensible Application Markup Language (XAML), you can use attribute syntax to describe a path.
<Path Stroke="Black" StrokeThickness="1" Data="M 10,100 Q 200,200 300,100" />
(Note that this attribute syntax actually creates a StreamGeometry, a lighter-weight version of a PathGeometry. For more information, see the Path Markup Syntax page.)
In XAML, you may also draw a quadratic Bezier curve using object element syntax. The following is equivalent to the previous XAML example.
<Path Stroke="Black" StrokeThickness="1"> <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigureCollection> <PathFigure StartPoint="10,100"> <PathFigure.Segments> <PathSegmentCollection> <QuadraticBezierSegment Point1="200,200" Point2="300,100" /> </PathSegmentCollection> </PathFigure.Segments> </PathFigure> </PathFigureCollection> </PathGeometry.Figures> </PathGeometry> </Path.Data> </Path>
This example is part of larger sample; for the complete sample, see the Geometries Sample.
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.Animation.Animatable
System.Windows.Media.PathSegment
System.Windows.Media.QuadraticBezierSegment
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.