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

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

語法

Status AddClosedCurve(
  [in] const Point *points,
  [in] INT         count
);

參數

[in] points

類型: const Point*

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

[in] count

類型: INT

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

傳回值

類型: 狀態

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

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

備註

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

範例

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

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

   Point pts[] = {Point(50,50),
                  Point(60,20),
                  Point(70,100),
                  Point(80,50)};

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

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

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限傳統型應用程式]
最低支援的伺服器 Windows 2000 Server [僅限傳統型應用程式]
目標平台 Windows
標頭 gdipluspath.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

AddBezier 方法

AddBeziers 方法

AddClosedCurve 方法

AddCurve 方法

基本曲線

使用區域裁剪

建構和繪製路徑

建立路徑漸層

繪製基數曲線

GraphicsPath

路徑