GraphicsPath::AddLine(constPointF&,constPointF&) メソッド (gdipluspath.h)

GraphicsPath::AddLine メソッドは、このパスの現在の図に行を追加します。

構文

Status AddLine(
  const PointF & pt1,
  const PointF & pt2
);

パラメーター

pt1

線を開始するポイントへの参照。

pt2

線を終了する点を参照します。

戻り値

Type:Status

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

メソッドが失敗した場合は、 Status 列挙体の他の要素のいずれかを返します。

解説

次の例では、 GraphicsPath オブジェクト パスを作成し、パスに線を追加してから、パスを描画します。

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

   PointF point1(20.0f, 20.0f);
   PointF point2(100.0f, 100.0f);

   GraphicsPath path;
   path.AddLine(point1, point2);

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

要件

要件
Header gdipluspath.h

こちらもご覧ください

AddLine メソッド

AddLines メソッド

領域を使用したクリッピング

パスの作成および描画

パス グラデーションの作成

Graphicspath

パス

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

Pointf

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