StreamGeometryContext.PolyBezierTo Yöntem

Tanım

Bir veya daha fazla bağlı Bezier eğrisi çizer.

C#
public abstract void PolyBezierTo(System.Collections.Generic.IList<System.Windows.Point> points, bool isStroked, bool isSmoothJoin);

Parametreler

points
IList<Point>

Bir veya daha fazla Bezier eğrisi için denetim noktalarını ve hedef noktaları belirten noktaların listesi. Bu listedeki nokta sayısı üç noktanın katı olmalıdır.

isStroked
Boolean

true , segmenti işlemek için kullanıldığında segmenti konturlu Pen hale getirmek için; aksi takdirde , false.

isSmoothJoin
Boolean

trueile vuruş yapıldığında bu segment ile Penönceki segment arasındaki birleştirmeyi köşe olarak ele almak için ; aksi takdirde . false

Özel durumlar

yöntemi çağrılarak bir şekil başlatılmadan bir kesim ekleme girişiminde bulunuldu BeginFigure(Point, Boolean, Boolean) .

Örnekler

Aşağıdaki örnekte, yöntemini kullanarak birden çok bağlı Bezier eğrisinin nasıl çiz olduğu PolyBezierTo gösterilmektedir.

C#
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace SDKSample
{
    public partial class StreamGeometryPolyBezierToExample : Page
    {
        public StreamGeometryPolyBezierToExample()
        {
            // Create a path to draw a geometry with.
            Path myPath = new Path();
            myPath.Stroke = Brushes.Black;
            myPath.StrokeThickness = 1;

            // Create a StreamGeometry to use to specify myPath.
            StreamGeometry geometry = new StreamGeometry();
            geometry.FillRule = FillRule.EvenOdd;

            // Open a StreamGeometryContext that can be used to describe this StreamGeometry 
            // object's contents.
            using (StreamGeometryContext ctx = geometry.Open())
            {
                // Set the begin point of the shape.
                ctx.BeginFigure(new Point(10, 100), true /* is filled */, false /* is closed */);

                // Create a collection of Point structures that will be used with the PolyBezierTo 
                // Method to create the Bezier curve.
                List<Point> pointList = new List<Point>();

                // First Bezier curve is specified with these three points.

                // First control point for first Bezier curve.
                pointList.Add(new Point(100,0));

                // Second control point for first Bezier curve.
                pointList.Add(new Point(200, 200));

                // Destination point for first Bezier curve.
                pointList.Add(new Point(300, 100));

                // Second Bezier curve is specified with these three points.

                // First control point for second Bezier curve.
                pointList.Add(new Point(400, 0));

                // Second control point for second Bezier curve.
                pointList.Add(new Point(500, 200));

                // Destination point for second Bezier curve.
                pointList.Add(new Point(600, 100));

                // Create a Bezier curve using the collection of Point Structures.
                ctx.PolyBezierTo(pointList, true /* is stroked */, false /* is smooth join */);
            }

            // Freeze the geometry (make it unmodifiable)
            // for additional performance benefits.
            geometry.Freeze();
            
            // specify the shape (Bezier curve) of the path using the StreamGeometry.
            myPath.Data = geometry;

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

Açıklamalar

içindeki ilk nokta points ilk denetim noktasını belirtir, sonraki ikinci denetim noktasını belirtir, üçüncü nokta bitiş noktasını belirtir, sonraki nokta sonraki eğrinin ilk denetim noktasını belirtir ve bu şekilde devam eder.

Bu yöntem, başlangıç noktası olarak önceki segmentin bitiş noktasını kullanır. Bu şekildeki ilk segmentse, başlangıç noktası olarak yöntemi tarafından BeginFigure belirtilen noktayı kullanır.

A StreamGeometry , bir veya herhangi bir Transform vuruşsuz veya doldurulmamış kesim içeriyorsa seri hale getirilemez.

Şunlara uygulanır

Ürün Sürümler
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Ayrıca bkz.