Graphics.FillPolygon Graphics.FillPolygon Graphics.FillPolygon Method

정의

Point 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by Point structures.

오버로드

FillPolygon(Brush, Point[]) FillPolygon(Brush, Point[]) FillPolygon(Brush, Point[])

Point 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by Point structures.

FillPolygon(Brush, PointF[]) FillPolygon(Brush, PointF[]) FillPolygon(Brush, PointF[])

PointF 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by PointF structures.

FillPolygon(Brush, Point[], FillMode) FillPolygon(Brush, Point[], FillMode) FillPolygon(Brush, Point[], FillMode)

지정된 채우기 모드를 사용하여 Point 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by Point structures using the specified fill mode.

FillPolygon(Brush, PointF[], FillMode) FillPolygon(Brush, PointF[], FillMode) FillPolygon(Brush, PointF[], FillMode)

지정된 채우기 모드를 사용하여 PointF 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by PointF structures using the specified fill mode.

FillPolygon(Brush, Point[]) FillPolygon(Brush, Point[]) FillPolygon(Brush, Point[])

Point 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by Point structures.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Point> ^ points);
public void FillPolygon (System.Drawing.Brush brush, System.Drawing.Point[] points);
member this.FillPolygon : System.Drawing.Brush * System.Drawing.Point[] -> unit

매개 변수

brush
Brush Brush Brush

채우기의 특징을 결정하는 Brush입니다.Brush that determines the characteristics of the fill.

points
Point[]

채울 다각형의 꼭짓점을 나타내는 Point 구조체의 배열입니다.Array of Point structures that represent the vertices of the polygon to fill.

예외

brushnull인 경우brush is null.

또는-or- pointsnull인 경우points is null.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 파란색 단색 브러시를 만듭니다.Creates a solid blue brush.

  • 7 개의 점이 다각형의 배열을 만듭니다.Creates an array of seven points to define a polygon.

  • 화면에 다각형 영역을 채웁니다.Fills the polygonal area on the screen.

public:
   void FillPolygonPoint( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create points that define polygon.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Draw polygon to screen.
      e->Graphics->FillPolygon( blueBrush, curvePoints );
   }
public void FillPolygonPoint(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create points that define polygon.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Draw polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints);
}
Public Sub FillPolygonPoint(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create points that define polygon.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Draw polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints)
End Sub

설명

배열에서 두 연속 점 모든 다각형의 한 쪽을 지정합니다.Every two consecutive points in the array specify a side of the polygon. 또한 첫 번째 지점과 마지막 지점 교차 하지 않을 경우 다각형의 닫는 쪽을 지정 합니다.In addition, if the last point and the first point do not coincide, they specify the closing side of the polygon.

FillPolygon(Brush, PointF[]) FillPolygon(Brush, PointF[]) FillPolygon(Brush, PointF[])

PointF 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by PointF structures.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points);
public void FillPolygon (System.Drawing.Brush brush, System.Drawing.PointF[] points);
member this.FillPolygon : System.Drawing.Brush * System.Drawing.PointF[] -> unit

매개 변수

brush
Brush Brush Brush

채우기의 특징을 결정하는 Brush입니다.Brush that determines the characteristics of the fill.

points
PointF[]

채울 다각형의 꼭짓점을 나타내는 PointF 구조체의 배열입니다.Array of PointF structures that represent the vertices of the polygon to fill.

예외

brushnull입니다.brush is null.

또는-or- pointsnull인 경우points is null.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 파란색 단색 브러시를 만듭니다.Creates a solid blue brush.

  • 7 개의 점이 다각형의 배열을 만듭니다.Creates an array of seven points to define a polygon.

  • 화면에 다각형 영역을 채웁니다.Fills the polygonal area on the screen.

public:
   void FillPolygonPointF( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create points that define polygon.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Fill polygon to screen.
      e->Graphics->FillPolygon( blueBrush, curvePoints );
   }
public void FillPolygonPointF(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create points that define polygon.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Fill polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints);
}
Public Sub FillPolygonPointF(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create points that define polygon.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Fill polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints)
End Sub

설명

배열에서 두 연속 점 모든 다각형의 한 쪽을 지정합니다.Every two consecutive points in the array specify a side of the polygon. 또한 첫 번째 지점과 마지막 지점 교차 하지 않을 경우 다각형의 닫는 쪽을 지정 합니다.In addition, if the last point and the first point do not coincide, they specify the closing side of the polygon.

FillPolygon(Brush, Point[], FillMode) FillPolygon(Brush, Point[], FillMode) FillPolygon(Brush, Point[], FillMode)

지정된 채우기 모드를 사용하여 Point 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by Point structures using the specified fill mode.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, cli::array <System::Drawing::Point> ^ points, System::Drawing::Drawing2D::FillMode fillMode);
public void FillPolygon (System.Drawing.Brush brush, System.Drawing.Point[] points, System.Drawing.Drawing2D.FillMode fillMode);
member this.FillPolygon : System.Drawing.Brush * System.Drawing.Point[] * System.Drawing.Drawing2D.FillMode -> unit

매개 변수

brush
Brush Brush Brush

채우기의 특징을 결정하는 Brush입니다.Brush that determines the characteristics of the fill.

points
Point[]

채울 다각형의 꼭짓점을 나타내는 Point 구조체의 배열입니다.Array of Point structures that represent the vertices of the polygon to fill.

fillMode
FillMode FillMode FillMode

채우기의 스타일을 결정하는 FillMode 열거형의 멤버입니다.Member of the FillMode enumeration that determines the style of the fill.

예외

brushnull입니다.brush is null.

또는-or- pointsnull인 경우points is null.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 이 코드에서는 다음 작업을 수행합니다.The code performs the following actions:

  • 파란색 단색 브러시를 만듭니다.Creates a solid blue brush.

  • 7 개의 점이 다각형의 배열을 만듭니다.Creates an array of seven points to define a polygon.

  • 채우기 모드를 설정 Winding합니다.Sets the fill mode to Winding.

  • 화면에 다각형 영역을 채웁니다.Fills the polygonal area on the screen.

public:
   void FillPolygonPointFillMode( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create points that define polygon.
      Point point1 = Point(50,50);
      Point point2 = Point(100,25);
      Point point3 = Point(200,5);
      Point point4 = Point(250,50);
      Point point5 = Point(300,100);
      Point point6 = Point(350,200);
      Point point7 = Point(250,250);
      array<Point>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Define fill mode.
      FillMode newFillMode = FillMode::Winding;

      // Draw polygon to screen.
      e->Graphics->FillPolygon( blueBrush, curvePoints, newFillMode );
   }
public void FillPolygonPointFillMode(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create points that define polygon.
    Point point1 = new Point(50, 50);
    Point point2 = new Point(100, 25);
    Point point3 = new Point(200, 5);
    Point point4 = new Point(250, 50);
    Point point5 = new Point(300, 100);
    Point point6 = new Point(350, 200);
    Point point7 = new Point(250, 250);
    Point[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Define fill mode.
    FillMode newFillMode = FillMode.Winding;

    // Draw polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints, newFillMode);
}
Public Sub FillPolygonPointFillMode(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create points that define polygon.
    Dim point1 As New Point(50, 50)
    Dim point2 As New Point(100, 25)
    Dim point3 As New Point(200, 5)
    Dim point4 As New Point(250, 50)
    Dim point5 As New Point(300, 100)
    Dim point6 As New Point(350, 200)
    Dim point7 As New Point(250, 250)
    Dim curvePoints As Point() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Define fill mode.
    Dim newFillMode As FillMode = FillMode.Winding

    ' Draw polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints, newFillMode)
End Sub

설명

배열에서 두 연속 점 모든 다각형의 한 쪽을 지정합니다.Every two consecutive points in the array specify a side of the polygon. 또한 첫 번째 지점과 마지막 지점 교차 하지 않을 경우 다각형의 닫는 쪽을 지정 합니다.In addition, if the last point and the first point do not coincide, they specify the closing side of the polygon.

FillPolygon(Brush, PointF[], FillMode) FillPolygon(Brush, PointF[], FillMode) FillPolygon(Brush, PointF[], FillMode)

지정된 채우기 모드를 사용하여 PointF 구조체에 의해 지정된 점의 배열에 의해 정의되는 다각형의 내부를 채웁니다.Fills the interior of a polygon defined by an array of points specified by PointF structures using the specified fill mode.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points, System::Drawing::Drawing2D::FillMode fillMode);
public void FillPolygon (System.Drawing.Brush brush, System.Drawing.PointF[] points, System.Drawing.Drawing2D.FillMode fillMode);
member this.FillPolygon : System.Drawing.Brush * System.Drawing.PointF[] * System.Drawing.Drawing2D.FillMode -> unit

매개 변수

brush
Brush Brush Brush

채우기의 특징을 결정하는 Brush입니다.Brush that determines the characteristics of the fill.

points
PointF[]

채울 다각형의 꼭짓점을 나타내는 PointF 구조체의 배열입니다.Array of PointF structures that represent the vertices of the polygon to fill.

fillMode
FillMode FillMode FillMode

채우기의 스타일을 결정하는 FillMode 열거형의 멤버입니다.Member of the FillMode enumeration that determines the style of the fill.

예외

brushnull입니다.brush is null.

또는-or- pointsnull인 경우points is null.

예제

다음 코드 예제는 Windows Forms에서 사용 하도록 설계 되었으며 필요 PaintEventArgs e의 매개 변수는 Paint 이벤트 처리기입니다.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. 코드에는 다음 작업을 수행합니다.The code performs the following action:

  • 파란색 단색 브러시를 만듭니다.Creates a solid blue brush.

  • 7 개의 점이 다각형의 배열을 만듭니다.Creates an array of seven points to define a polygon.

  • 채우기 모드를 설정 Winding합니다.Sets the fill mode to Winding.

  • 화면에 다각형 영역을 채웁니다.Fills the polygonal area on the screen.

public:
   void FillPolygonPointFFillMode( PaintEventArgs^ e )
   {
      // Create solid brush.
      SolidBrush^ blueBrush = gcnew SolidBrush( Color::Blue );

      // Create points that define polygon.
      PointF point1 = PointF(50.0F,50.0F);
      PointF point2 = PointF(100.0F,25.0F);
      PointF point3 = PointF(200.0F,5.0F);
      PointF point4 = PointF(250.0F,50.0F);
      PointF point5 = PointF(300.0F,100.0F);
      PointF point6 = PointF(350.0F,200.0F);
      PointF point7 = PointF(250.0F,250.0F);
      array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7};

      // Define fill mode.
      FillMode newFillMode = FillMode::Winding;

      // Fill polygon to screen.
      e->Graphics->FillPolygon( blueBrush, curvePoints, newFillMode );
   }
public void FillPolygonPointFFillMode(PaintEventArgs e)
{

    // Create solid brush.
    SolidBrush blueBrush = new SolidBrush(Color.Blue);

    // Create points that define polygon.
    PointF point1 = new PointF(50.0F, 50.0F);
    PointF point2 = new PointF(100.0F, 25.0F);
    PointF point3 = new PointF(200.0F, 5.0F);
    PointF point4 = new PointF(250.0F, 50.0F);
    PointF point5 = new PointF(300.0F, 100.0F);
    PointF point6 = new PointF(350.0F, 200.0F);
    PointF point7 = new PointF(250.0F, 250.0F);
    PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};

    // Define fill mode.
    FillMode newFillMode = FillMode.Winding;

    // Fill polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints, newFillMode);
}
Public Sub FillPolygonPointFFillMode(ByVal e As PaintEventArgs)

    ' Create solid brush.
    Dim blueBrush As New SolidBrush(Color.Blue)

    ' Create points that define polygon.
    Dim point1 As New PointF(50.0F, 50.0F)
    Dim point2 As New PointF(100.0F, 25.0F)
    Dim point3 As New PointF(200.0F, 5.0F)
    Dim point4 As New PointF(250.0F, 50.0F)
    Dim point5 As New PointF(300.0F, 100.0F)
    Dim point6 As New PointF(350.0F, 200.0F)
    Dim point7 As New PointF(250.0F, 250.0F)
    Dim curvePoints As PointF() = {point1, point2, point3, point4, _
    point5, point6, point7}

    ' Define fill mode.
    Dim newFillMode As FillMode = FillMode.Winding

    ' Fill polygon to screen.
    e.Graphics.FillPolygon(blueBrush, curvePoints, newFillMode)
End Sub

설명

배열에서 두 연속 점 모든 다각형의 한 쪽을 지정합니다.Every two consecutive points in the array specify a side of the polygon. 또한 첫 번째 지점과 마지막 지점 교차 하지 않을 경우 다각형의 닫는 쪽을 지정 합니다.In addition, if the last point and the first point do not coincide, they specify the closing side of the polygon.

적용 대상