GraphicsPath.AddClosedCurve 方法

定义

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

重载

AddClosedCurve(Point[])

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

AddClosedCurve(PointF[])

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

AddClosedCurve(ReadOnlySpan<Point>)
AddClosedCurve(ReadOnlySpan<PointF>)
AddClosedCurve(Point[], Single)

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

AddClosedCurve(PointF[], Single)

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

AddClosedCurve(ReadOnlySpan<Point>, Single)
AddClosedCurve(ReadOnlySpan<PointF>, Single)

AddClosedCurve(Point[])

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

public:
 void AddClosedCurve(cli::array <System::Drawing::Point> ^ points);
public:
 void AddClosedCurve(... cli::array <System::Drawing::Point> ^ points);
public void AddClosedCurve (System.Drawing.Point[] points);
public void AddClosedCurve (params System.Drawing.Point[] points);
member this.AddClosedCurve : System.Drawing.Point[] -> unit
Public Sub AddClosedCurve (points As Point())
Public Sub AddClosedCurve (ParamArray points As Point())

参数

points
Point[]

一个 Point 结构的数组,它表示定义曲线的点。

示例

有关示例,请参见 AddClosedCurve(Point[], Single)

注解

如果需要,用户必须保留原始点。 原始点在内部转换为三次方贝塞尔控制点,因此没有返回原始点的机制。 如果数组中的 points 第一个点和最后一个点不是同一个点,则通过连接这两个点来关闭曲线。 不能为此方法设置紧张值,并且默认为等效于 0.5 的值。

适用于

AddClosedCurve(PointF[])

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

public:
 void AddClosedCurve(cli::array <System::Drawing::PointF> ^ points);
public:
 void AddClosedCurve(... cli::array <System::Drawing::PointF> ^ points);
public void AddClosedCurve (System.Drawing.PointF[] points);
public void AddClosedCurve (params System.Drawing.PointF[] points);
member this.AddClosedCurve : System.Drawing.PointF[] -> unit
Public Sub AddClosedCurve (points As PointF())
Public Sub AddClosedCurve (ParamArray points As PointF())

参数

points
PointF[]

一个 PointF 结构的数组,它表示定义曲线的点。

示例

有关示例,请参见 AddClosedCurve(Point[], Single)

注解

如果需要,用户必须保留原始点。 原始点在内部转换为三次方贝塞尔控制点,因此没有返回原始点的机制。 如果数组中的 points 第一个点和最后一个点不是同一个点,则通过连接这两个点来关闭曲线。 不能为此方法设置紧张值,并且默认为等效于 0.5 的值。

适用于

AddClosedCurve(ReadOnlySpan<Point>)

Source:
GraphicsPath.cs
public:
 void AddClosedCurve(ReadOnlySpan<System::Drawing::Point> points);
public void AddClosedCurve (ReadOnlySpan<System.Drawing.Point> points);
member this.AddClosedCurve : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddClosedCurve (points As ReadOnlySpan(Of Point))

参数

适用于

AddClosedCurve(ReadOnlySpan<PointF>)

Source:
GraphicsPath.cs
public:
 void AddClosedCurve(ReadOnlySpan<System::Drawing::PointF> points);
public void AddClosedCurve (ReadOnlySpan<System.Drawing.PointF> points);
member this.AddClosedCurve : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddClosedCurve (points As ReadOnlySpan(Of PointF))

参数

适用于

AddClosedCurve(Point[], Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

public:
 void AddClosedCurve(cli::array <System::Drawing::Point> ^ points, float tension);
public void AddClosedCurve (System.Drawing.Point[] points, float tension);
member this.AddClosedCurve : System.Drawing.Point[] * single -> unit
Public Sub AddClosedCurve (points As Point(), tension As Single)

参数

points
Point[]

一个 Point 结构的数组,它表示定义曲线的点。

tension
Single

介于 0 到 1 之间的一个值,它指定曲线在点与点之间弯曲的程度,0 表示最小弯曲(最锐拐角),1 表示最平滑弯曲。

示例

下面的代码示例设计用于 Windows 窗体,它需要 PaintEventArgse事件OnPaint对象。 此代码执行以下操作:

  • 创建一个由六个点构成的数组, (表示基数样条) 。

  • 创建一个路径,并将闭合基数样条曲线添加到 (从端点关闭到起点) 的路径。

  • 绘制到屏幕的路径。

请注意,使用 0.5 的紧张度。

private:
   void AddClosedCurveExample( PaintEventArgs^ e )
   {
      // Creates a symetrical, closed curve.
      array<Point>^ myArray = {Point(20,100),Point(40,150),Point(60,125),Point(40,100),Point(60,75),Point(40,50)};

      // Create a new path and add curve.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddClosedCurve( myArray, .5f );
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );

      // Draw the path to screen.
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddClosedCurveExample(PaintEventArgs e)
{
             
    // Creates a symmetrical, closed curve.
    Point[] myArray =
             {
                 new Point(20,100),
                 new Point(40,150),
                 new Point(60,125),
                 new Point(40,100),
                 new Point(60,75),
                 new Point(40,50)
             };
             
    // Create a new path and add curve.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddClosedCurve(myArray,.5f);
    Pen myPen = new Pen(Color.Black, 2);
             
    // Draw the path to screen.
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddClosedCurveExample(ByVal e As PaintEventArgs)

    ' Creates a symmetrical, closed curve.
    Dim myArray As Point() = {New Point(20, 100), New Point(40, 150), _
    New Point(60, 125), New Point(40, 100), New Point(60, 75), _
    New Point(40, 50)}
    Dim myPath As New GraphicsPath
    myPath.AddClosedCurve(myArray, 0.5F)
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub

注解

如果需要,用户必须保留原始点。 原始点在内部转换为三次方贝塞尔控制点,因此没有返回原始点的机制。 如果数组中的 points 第一个点和最后一个点不是同一个点,则通过连接这两个点来关闭曲线。

适用于

AddClosedCurve(PointF[], Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

向此路径添加一个闭合曲线。 由于曲线经过数组中的每个点,因此使用基数样条曲线。

public:
 void AddClosedCurve(cli::array <System::Drawing::PointF> ^ points, float tension);
public void AddClosedCurve (System.Drawing.PointF[] points, float tension);
member this.AddClosedCurve : System.Drawing.PointF[] * single -> unit
Public Sub AddClosedCurve (points As PointF(), tension As Single)

参数

points
PointF[]

一个 PointF 结构的数组,它表示定义曲线的点。

tension
Single

介于 0 到 1 之间的一个值,它指定曲线在点与点之间弯曲的程度,0 表示最小弯曲(最锐拐角),1 表示最平滑弯曲。

示例

有关示例,请参见 AddClosedCurve(Point[], Single)

注解

如果需要,用户必须保留原始点。 原始点在内部转换为三次方贝塞尔控制点,因此没有返回原始点的机制。 如果数组中的 points 第一个点和最后一个点不是同一个点,则通过连接这两个点来关闭曲线。

适用于

AddClosedCurve(ReadOnlySpan<Point>, Single)

Source:
GraphicsPath.cs
public:
 void AddClosedCurve(ReadOnlySpan<System::Drawing::Point> points, float tension);
public void AddClosedCurve (ReadOnlySpan<System.Drawing.Point> points, float tension);
member this.AddClosedCurve : ReadOnlySpan<System.Drawing.Point> * single -> unit
Public Sub AddClosedCurve (points As ReadOnlySpan(Of Point), tension As Single)

参数

tension
Single

适用于

AddClosedCurve(ReadOnlySpan<PointF>, Single)

Source:
GraphicsPath.cs
public:
 void AddClosedCurve(ReadOnlySpan<System::Drawing::PointF> points, float tension);
public void AddClosedCurve (ReadOnlySpan<System.Drawing.PointF> points, float tension);
member this.AddClosedCurve : ReadOnlySpan<System.Drawing.PointF> * single -> unit
Public Sub AddClosedCurve (points As ReadOnlySpan(Of PointF), tension As Single)

参数

tension
Single

适用于