Share via


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

GraphicsPath::AddLines 方法會將一連線序列新增至此路徑的目前圖形。

語法

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

參數

points

指定線條起點和結束點之點陣列的指標。 陣列中的第一個點是第一行的起點,而陣列中的最後一個點是最後一行的結束點。 每一個其他點都會當做一行的結束點,以及下一行的起點。

count

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

傳回值

Type:Status

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

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

備註

範例

下列範例會建立 GraphicsPath 物件路徑、將四條連接的線條序列新增至路徑,然後繪製路徑。

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

   PointF pts[] = {PointF(20.0f, 20.0f),
                   PointF(30.0f, 30.0f),
                   PointF(40.0f, 25.0f),
                   PointF(50.0f, 30.0f),
                   PointF(60.0f, 20.0f)};

   GraphicsPath path;
   path.AddLines(pts, 5);

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

規格需求

需求
標頭 gdipluspath.h

另請參閱

AddLine 方法

AddLines 方法

使用區域裁剪

建構和繪製路徑

建立路徑漸層

GraphicsPath

路徑

畫筆、線條和矩形

PointF

使用畫筆繪製線條和矩形