共用方式為


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[])

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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[])

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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>)

來源:
GraphicsPath.cs
來源:
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>)

來源:
GraphicsPath.cs
來源:
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)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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 Forms 搭配使用,而且需要 PaintEventArgseOnPaint 事件物件。 程式代碼會執行下列動作:

  • 建立六個點的陣列(代表基數曲線)。

  • 建立路徑,並將封閉的基數曲線新增至路徑(從端點關閉至起點)。

  • 繪製畫面的路徑。

請注意,使用 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)

來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
GraphicsPath.cs
來源:
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)

來源:
GraphicsPath.cs
來源:
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)

來源:
GraphicsPath.cs
來源:
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

適用於