Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PolyQuadraticBezierSegment Class

Represents a set of quadratic Bezier segments.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public sealed class PolyQuadraticBezierSegment : PathSegment
<PolyQuadraticBezierSegment .../>

This class enables you to specify a collection of points to create multiple quadratic Bezier curve segments. With a QuadraticBezierSegment, you can specify only two points to create a single quadratic Bezier curve segment.

The following example shows how to use PolyQuadraticBezierSegment to create two quadratic Bezier curve segments.

<Page xmlns=""
      <Path Stroke="Black" StrokeThickness="1">

                <!-- The StartPoint specifies the starting point of the first curve. -->
                <PathFigure StartPoint="10,100">

                      <!-- The PolyQuadraticBezierSegment specifies two Bezier curves.
                           The first curve is from 10,100 (start point specified above)
                           to 300,100 with a control point of 200,200. The second curve
                           is from 200,200 (end of the last curve) to 30,400 with a 
                           control point of 0,200. -->
                      <PolyQuadraticBezierSegment Points="200,200 300,100 0,200 30,400" />
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace SDKSample
    public partial class PolyQuadraticBezierSegmentExample : Page
        public PolyQuadraticBezierSegmentExample()

            // Create a PathFigure to be used for the PathGeometry of myPath.
            PathFigure myPathFigure = new PathFigure();

            // Set the starting point for the PathFigure specifying that the 
            // geometry starts at point 10,100.
            myPathFigure.StartPoint = new Point(10, 100);

            // Create a PointCollection that holds the Points used to specify  
            // the points of the PolyQuadraticBezierSegment below.
            PointCollection myPointCollection = new PointCollection(4);
            myPointCollection.Add(new Point(200, 200));
            myPointCollection.Add(new Point(300, 100));
            myPointCollection.Add(new Point(0, 200));
            myPointCollection.Add(new Point(30, 400));

            // The PolyQuadraticBezierSegment specifies two Bezier curves. 
            // The first curve is from 10,100 (start point specified above) 
            // to 300,100 with a control point of 200,200. The second curve 
            // is from 200,200 (end of the last curve) to 30,400 with a  
            // control point of 0,200.
            PolyQuadraticBezierSegment myBezierSegment = new PolyQuadraticBezierSegment();
            myBezierSegment.Points = myPointCollection;

            PathSegmentCollection myPathSegmentCollection = new PathSegmentCollection();

            myPathFigure.Segments = myPathSegmentCollection;

            PathFigureCollection myPathFigureCollection = new PathFigureCollection();

            PathGeometry myPathGeometry = new PathGeometry();
            myPathGeometry.Figures = myPathFigureCollection;

            // Create a path to draw a geometry with.
            Path myPath = new Path();
            myPath.Stroke = Brushes.Black;
            myPath.StrokeThickness = 1;

            // specify the shape (quadratic Bezier curve) of the path using the StreamGeometry.
            myPath.Data = myPathGeometry;

            // Add path shape to the UI.
            StackPanel mainPanel = new StackPanel();
            this.Content = mainPanel;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.5, 3.0
© 2018 Microsoft