GraphicsPath::AddClosedCurve(constPointF*,INT) 方法 (gdipluspath.h)

GraphicsPath::AddClosedCurve 方法會將封閉基數曲線新增至此路徑。

語法

Status AddClosedCurve(
  const PointF *points,
  INT          count
);

參數

points

定義基數曲線之點陣列的指標。 基數曲線是通過陣列中每個點的曲線。

count

整數,指定點陣列中的項目數目。

傳回值

類型:狀態

如果方法成功,它會傳回Ok,這是 Status 列舉的元素。

如果方法失敗,它會傳回 Status 列舉的其他元素之一。

言論

如果稍後需要這些點,您應該保留點陣列的複本。 GraphicsPath 物件不會儲存傳遞至 GraphicsPath::AddClosedCurve 方法的點:相反地,它會將基數曲線轉換成貝塞爾曲線序列,並儲存定義這些貝塞爾曲線的點。 您無法從 GraphicsPath 物件擷取原始的點陣列。

例子

下列範例會建立 GraphicsPath 對象路徑、將封閉基底曲線新增至路徑,然後繪製路徑。

VOID Example_AddClosedCurve(HDC hdc)
{
   Graphics graphics(hdc);

   PointF pts[] = {PointF(50.0f,50.0f),
                   PointF(60.0f,20.0f),
                   PointF(70.0f,100.0f),
                   PointF(80.0f,50.0f)};

   GraphicsPath path;
   path.AddClosedCurve(pts, 4);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

要求

要求 價值
標頭 gdipluspath.h

另請參閱

AddBezier 方法

AddBeziers 方法

AddCurve 方法

貝塞爾曲線

使用區域 進行裁剪

建構和繪製路徑

建立路徑漸層

繪製貝氏曲線

GraphicsPath

路徑