Share via


Graphics::D rawLines (constPen*,constPoint*,INT) 方法 (gdiplusgraphics.h)

Graphics::D rawLines方法會繪製一連串的線條。

語法

Status DrawLines(
  [in] const Pen   *pen,
  [in] const Point *points,
  [in] INT         count
);

參數

[in] pen

類型:const Pen*

用來繪製線條的畫筆指標。

[in] points

類型:const Point*

Point物件的陣列指標,指定行的起點和結束點。

[in] count

類型: INT

指定 陣列中專案數的整數。

傳回值

類型: 狀態

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

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

備註

每一行都需要起點和結束點。 每一行的結束點是下一行的起點。

範例

下列範例會繪製一連線序列。


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

   // Create a Pen object.
   Pen blackPen(Color(255, 0, 0, 0), 3);

   // Create an array of Point objects that define the lines to draw.
   Point point1(10, 10);
   Point point2(10, 100);
   Point point3(200, 50);
   Point point4(250, 300);

   Point points[4] = {point1, point2, point3, point4};
   Point* pPoints = points;

   // Draw the lines.
   graphics.DrawLines(&blackPen, pPoints, 4);
}

需求

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

另請參閱

DrawLine 方法

圖形

畫筆、線條和矩形

使用畫筆繪製線條和矩形