次の方法で共有


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

ポイント配列内の要素の数を指定する整数。

戻り値

メソッドが成功した場合は、Status 列挙の要素である Ok を返します

メソッドが失敗した場合は、 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);
}

必要条件

   
Header gdiplusgraphics.h

関連項目

DrawLine メソッド

グラフィックス

ペン、直線、および四角形

Point

ペンを使用した直線と四角形の描画