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

將關閉曲線加入這個路徑。 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。

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

將關閉曲線加入這個路徑。 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。

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
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
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

將關閉曲線加入這個路徑。 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。

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 使用,而且需要 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)

來源:
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
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
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

適用於