GraphicsPath.AddBeziers 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将连接的立方贝塞尔曲线序列添加到当前图中。
重载
| AddBeziers(ReadOnlySpan<PointF>) | |
| AddBeziers(ReadOnlySpan<Point>) | |
| AddBeziers(Point[]) | 将连接的立方贝塞尔曲线序列添加到当前图中。 | 
| AddBeziers(PointF[]) | 将连接的立方贝塞尔曲线序列添加到当前图中。 | 
AddBeziers(ReadOnlySpan<PointF>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
 void AddBeziers(ReadOnlySpan<System::Drawing::PointF> points);public void AddBeziers (scoped ReadOnlySpan<System.Drawing.PointF> points);member this.AddBeziers : ReadOnlySpan<System.Drawing.PointF> -> unitPublic Sub AddBeziers (points As ReadOnlySpan(Of PointF))参数
- points
- ReadOnlySpan<PointF>
适用于
AddBeziers(ReadOnlySpan<Point>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
 void AddBeziers(ReadOnlySpan<System::Drawing::Point> points);public void AddBeziers (scoped ReadOnlySpan<System.Drawing.Point> points);member this.AddBeziers : ReadOnlySpan<System.Drawing.Point> -> unitPublic Sub AddBeziers (points As ReadOnlySpan(Of Point))参数
- points
- ReadOnlySpan<Point>
适用于
AddBeziers(Point[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
将连接的立方贝塞尔曲线序列添加到当前图中。
public:
 void AddBeziers(... cli::array <System::Drawing::Point> ^ points);public:
 void AddBeziers(cli::array <System::Drawing::Point> ^ points);public void AddBeziers (params System.Drawing.Point[] points);public void AddBeziers (System.Drawing.Point[] points);member this.AddBeziers : System.Drawing.Point[] -> unitPublic Sub AddBeziers (ParamArray points As Point())Public Sub AddBeziers (points As Point())参数
示例
下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:
- 创建一个由七个点构成的数组(表示两条连接的贝塞尔曲线)。 
- 创建路径并将一系列 Bézier 曲线点添加到路径。 
- 绘制屏幕的路径。 
private:
   void AddBeziersExample( PaintEventArgs^ e )
   {
      // Adds two Bezier curves.
      array<Point>^ myArray = {Point(20,100),Point(40,75),Point(60,125),Point(80,100),Point(100,50),Point(120,150),Point(140,100)};
      // Create the path and add the curves.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddBeziers( myArray );
      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddBeziersExample(PaintEventArgs e)
{
             
    // Adds two Bezier curves.
    Point[] myArray =
             {
                 new Point(20, 100),
                 new Point(40, 75),
                 new Point(60, 125),
                 new Point(80, 100),
                 new Point(100, 50),
                 new Point(120, 150),
                 new Point(140, 100)
             };
             
    // Create the path and add the curves.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddBeziers(myArray);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddBeziersExample(ByVal e As PaintEventArgs)
    ' Adds two Bezier curves.
    Dim myArray As Point() = {New Point(20, 100), New Point(40, 75), _
    New Point(60, 125), New Point(80, 100), New Point(100, 50), _
    New Point(120, 150), New Point(140, 100)}
    Dim myPath As New GraphicsPath
    myPath.AddBeziers(myArray)
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub
注解
              points 参数指定连接的曲线的终结点和控制点数组。 第一条曲线使用第二和第三个点作为控制点,从第一个点构造到 points 数组中的第四个点。 除了上一条曲线的端点外,序列中的每个后续曲线还需要三个点:序列中的接下来两个点是控制点,第三个是添加曲线的端点。
如果图中有上一条线或曲线,则会添加一条线,用于将上一段的端点连接到序列中第一条立方曲线的起点。
适用于
AddBeziers(PointF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
将连接的立方贝塞尔曲线序列添加到当前图中。
public:
 void AddBeziers(cli::array <System::Drawing::PointF> ^ points);public:
 void AddBeziers(... cli::array <System::Drawing::PointF> ^ points);public void AddBeziers (System.Drawing.PointF[] points);public void AddBeziers (params System.Drawing.PointF[] points);member this.AddBeziers : System.Drawing.PointF[] -> unitPublic Sub AddBeziers (points As PointF())Public Sub AddBeziers (ParamArray points As PointF())参数
示例
有关示例,请参阅:
注解
              points 参数指定连接的曲线的终结点和控制点数组。 第一条曲线使用第二和第三个点作为控制点,从第一个点构造到 points 数组中的第四个点。 除了上一条曲线的端点外,序列中的每个后续曲线还需要三个点:序列中的接下来两个点是控制点,第三个是添加曲线的端点。
如果图中有上一条线或曲线,则会添加一条线,用于将上一段的端点连接到序列中第一条立方曲线的起点。