## 定義

パスに多角形を追加します。Adds a polygon to this path.

## オーバーロード

パスに多角形を追加します。Adds a polygon to this path.

``````public:
``public void AddPolygon (System.Drawing.Point[] points);``
``member this.AddPolygon : System.Drawing.Point[] -> unit``
``Public Sub AddPolygon (points As Point())``

points
Point[]

### 例

• 多角形を定義する点の配列を作成します。Creates an array of points that defines a polygon.

• パスを作成し、そのパスに多角形を追加します。Creates a path and adds the polygon to the path.

• 画面へのパスを描画します。Draws the path to the screen.

``````private:
{
// 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;

// 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();

// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
``````
``````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

' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
``````

### 適用対象

パスに多角形を追加します。Adds a polygon to this path.

``````public:
``public void AddPolygon (System.Drawing.PointF[] points);``
``member this.AddPolygon : System.Drawing.PointF[] -> unit``
``Public Sub AddPolygon (points As PointF())``

points
PointF[]