GraphicsPath.AddPolygonとは? わかりやすく解説

GraphicsPath.AddPolygon メソッド (Point[])

パス多角形追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

解説解説

points 配列の点によって、多角形頂点指定されます。配列内の最初の点と最後の点が同じ点ない場合は、これらの 2 つの点をつなぐことにより多角形閉じられます。

使用例使用例

次のコード例は、Windows フォームでの使用意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコード次のアクション実行します

Public Sub AddPolygonExample(ByVal
 e As PaintEventArgs)

    ' Create an array of points.
    Dim myArray As Point() = {New Point(23,
 20), New Point(40, 10), _
    New Point(57, 20), New Point(50, 40), New
 Point(30, 40)}

    ' Create a GraphicsPath object and add a polygon.
    Dim myPath As New GraphicsPath
    myPath.AddPolygon(myArray)

    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black,
 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub
private void AddPolygonExample(PaintEventArgs
 e)
{
             
    // Create an array of points.
    Point[] myArray =
             {
                 new Point(23, 20),
                 new Point(40, 10),
                 new Point(57, 20),
                 new Point(50, 40),
                 new Point(30, 40)
             };
             
    // Create a GraphicsPath object and add a polygon.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddPolygon(myArray);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
private:
   void AddPolygonExample( PaintEventArgs^ e )
   {
      // Create an array of points.
      array<Point>^ myArray = {Point(23,20),Point(40,10),Point(57,20),Point(50
,40),Point(30,40)};

      // Create a GraphicsPath object and add a polygon.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddPolygon( myArray );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddPolygonExample(PaintEventArgs
 e)
{
    // Create an array of points.
    Point myArray[] = { new Point(23, 20), new
 Point(40, 10), 
                        new Point(57, 20), new
 Point(50, 40), 
                        new Point(30, 40) };

    // Create a GraphicsPath object and add a polygon.
    GraphicsPath myPath = new GraphicsPath();

    myPath.AddPolygon(myArray);

    // Draw the path to the screen.
    Pen myPen = new Pen(Color.get_Black(), 2);

    e.get_Graphics().DrawPath(myPen, myPath);
} //AddPolygonExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddPolygon メソッド (PointF[])

パス多角形追加します

名前空間: System.Drawing.Drawing2D
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub AddPolygon ( _
    points As PointF() _
)
Dim instance As GraphicsPath
Dim points As PointF()

instance.AddPolygon(points)
public void AddPolygon (
    PointF[] points
)
public:
void AddPolygon (
    array<PointF>^ points
)
public void AddPolygon (
    PointF[] points
)
public function AddPolygon (
    points : PointF[]
)

パラメータ

points

追加する多角形定義する PointF 構造体配列

解説解説

points 配列の点によって、多角形頂点指定されます。配列内の最初の点と最後の点が同じ点ない場合は、これらの 2 つの点をつなぐことにより多角形閉じられます。

使用例使用例
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.AddPolygon メソッド

パス多角形追加します
オーバーロードの一覧オーバーロードの一覧

名前 説明
GraphicsPath.AddPolygon (Point[]) パス多角形追加します
GraphicsPath.AddPolygon (PointF[]) パス多角形追加します
参照参照

関連項目

GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphicsPath.AddPolygonを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphicsPath.AddPolygonを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphicsPath.AddPolygon を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「GraphicsPath.AddPolygon」の関連用語

GraphicsPath.AddPolygonのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GraphicsPath.AddPolygonのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS