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

Graphics::D rawLines 方法绘制一系列连接线。

语法

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

parameters

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 方法

显卡

笔、线条和矩形

Point

使用笔绘制线条和矩形