Share via


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

Graphics::D rawLines方法會繪製連接線條序列。

語法

Status DrawLines(
  const Pen    *pen,
  const PointF *points,
  INT          count
);

參數

pen

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

points

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

count

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

傳回值

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

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

備註

範例

下列範例會繪製連接線的序列。

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

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

   // Create an array of PointF objects that define the lines to draw.
   PointF point1(10.0f, 10.0f);
   PointF point2(10.0f, 100.0f);
   PointF point3(200.0f, 50.0f);
   PointF point4(250.0f, 300.0f);

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

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

需求

   
標頭 gdiplusgraphics.h

另請參閱

DrawLine 方法

圖形

畫筆、線條和矩形

使用畫筆繪製線條和矩形