GraphicsPath::AddPolygon(constPoint*,INT) メソッド (gdipluspath.h)

GraphicsPath::AddPolygon メソッドは、このパスに多角形を追加します。

構文

Status AddPolygon(
  [in] const Point *points,
  [in] INT         count
);

パラメーター

[in] points

型: const Point*

多角形の頂点を指定するポイントの配列へのポインター。

[in] count

型: INT

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

戻り値

種類: 状態

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

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

注釈

GraphicsPath::AddPolygon メソッドは AddLines メソッドに似ています。 違いは、多角形は本質的に閉じた図形ですが、 GraphicsPath::CloseFigure を呼び出さない限り、一連の線は閉じた図形ではありません。 Windows GDI+ がパスをレンダリングすると、そのパス内の各多角形が閉じられます。つまり、ポリゴンの最後の頂点は、直線によって最初の頂点に接続されます。

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

VOID Example_AddPolygon(HDC hdc)
{
   Graphics graphics(hdc); 
 
   Point pts[] = {Point(20, 20),
                  Point(120, 20),
                  Point(120, 70)};

   GraphicsPath path;
   path.AddPolygon(pts, 3);

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

要件

要件
サポートされている最小のクライアント Windows XP、Windows 2000 Professional [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー gdipluspath.h (Gdiplus.h を含む)
Library Gdiplus.lib
[DLL] Gdiplus.dll

こちらもご覧ください

AddPolygon メソッド

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

パスの作成および描画

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

Graphicspath

パス

Point

多角形