Graphics.FillPolygon Metod

Definition

Fyller det inre i en polygon som definieras av en matris med punkter som anges av Point strukturer.

Överlagringar

Name Description
FillPolygon(Brush, ReadOnlySpan<PointF>, FillMode)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

FillPolygon(Brush, ReadOnlySpan<Point>, FillMode)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

FillPolygon(Brush, PointF[], FillMode)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av PointF det angivna fyllningsläget.

FillPolygon(Brush, Point[], FillMode)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

FillPolygon(Brush, ReadOnlySpan<Point>)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

FillPolygon(Brush, PointF[])

Fyller det inre i en polygon som definieras av en matris med punkter som anges av PointF strukturer.

FillPolygon(Brush, Point[])

Fyller det inre i en polygon som definieras av en matris med punkter som anges av Point strukturer.

FillPolygon(Brush, ReadOnlySpan<PointF>)

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

FillPolygon(Brush, ReadOnlySpan<PointF>, FillMode)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points, System::Drawing::Drawing2D::FillMode fillMode);
public void FillPolygon(System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.PointF> points, System.Drawing.Drawing2D.FillMode fillMode);
member this.FillPolygon : System.Drawing.Brush * ReadOnlySpan<System.Drawing.PointF> * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillPolygon (brush As Brush, points As ReadOnlySpan(Of PointF), fillMode As FillMode)

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
ReadOnlySpan<PointF>

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

fillMode
FillMode

Medlem i uppräkningen FillMode som avgör fyllningens format.

Gäller för

FillPolygon(Brush, ReadOnlySpan<Point>, FillMode)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points, System::Drawing::Drawing2D::FillMode fillMode);
public void FillPolygon(System.Drawing.Brush brush, ReadOnlySpan<System.Drawing.Point> points, System.Drawing.Drawing2D.FillMode fillMode);
member this.FillPolygon : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Point> * System.Drawing.Drawing2D.FillMode -> unit
Public Sub FillPolygon (brush As Brush, points As ReadOnlySpan(Of Point), fillMode As FillMode)

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
ReadOnlySpan<Point>

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

fillMode
FillMode

Medlem i uppräkningen FillMode som avgör fyllningens format.

Gäller för

FillPolygon(Brush, PointF[], FillMode)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av PointF det angivna fyllningsläget.

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
Public Sub FillPolygon (brush As Brush, points As PointF(), fillMode As FillMode)

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
PointF[]

Matris med PointF strukturer som representerar hörnen i polygonen som ska fyllas.

fillMode
FillMode

Medlem i uppräkningen FillMode som avgör fyllningens format.

Undantag

brush är null.

-eller-

points är null.

Exempel

Följande kodexempel är utformat för användning med Windows Forms och kräver PaintEventArgse, vilket är en parameter för händelsehanteraren Paint. Koden utför följande åtgärd:

  • Skapar en helblå pensel.

  • Skapar en matris med sju punkter för att definiera en polygon.

  • Anger fyllningsläget till Winding.

  • Fyller det polygonala området på skärmen.

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

Kommentarer

Varannat på varandra följande punkter i matrisen anger en sida av polygonen. Om den sista punkten och den första punkten inte sammanfaller anger de dessutom polygonens slutsida.

Gäller för

FillPolygon(Brush, Point[], FillMode)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

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
Public Sub FillPolygon (brush As Brush, points As Point(), fillMode As FillMode)

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
Point[]

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

fillMode
FillMode

Medlem i uppräkningen FillMode som avgör fyllningens format.

Undantag

brush är null.

-eller-

points är null.

Exempel

Följande kodexempel är utformat för användning med Windows Forms och kräver PaintEventArgse, vilket är en parameter för händelsehanteraren Paint. Koden utför följande åtgärder:

  • Skapar en helblå pensel.

  • Skapar en matris med sju punkter för att definiera en polygon.

  • Anger fyllningsläget till Winding.

  • Fyller det polygonala området på skärmen.

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

Kommentarer

Varannat på varandra följande punkter i matrisen anger en sida av polygonen. Om den sista punkten och den första punkten inte sammanfaller anger de dessutom polygonens slutsida.

Gäller för

FillPolygon(Brush, ReadOnlySpan<Point>)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::Point> points);
public void FillPolygon(System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.Point> points);
member this.FillPolygon : System.Drawing.Brush * ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub FillPolygon (brush As Brush, points As ReadOnlySpan(Of Point))

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
ReadOnlySpan<Point>

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

Gäller för

FillPolygon(Brush, PointF[])

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller det inre i en polygon som definieras av en matris med punkter som anges av PointF strukturer.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, ... cli::array <System::Drawing::PointF> ^ points);
public:
 void FillPolygon(System::Drawing::Brush ^ brush, cli::array <System::Drawing::PointF> ^ points);
public void FillPolygon(System.Drawing.Brush brush, params 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
Public Sub FillPolygon (brush As Brush, ParamArray points As PointF())
Public Sub FillPolygon (brush As Brush, points As PointF())

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
PointF[]

Matris med PointF strukturer som representerar hörnen i polygonen som ska fyllas.

Undantag

brush är null.

-eller-

points är null.

Exempel

Följande kodexempel är utformat för användning med Windows Forms och kräver PaintEventArgse, vilket är en parameter för händelsehanteraren Paint. Koden utför följande åtgärder:

  • Skapar en helblå pensel.

  • Skapar en matris med sju punkter för att definiera en polygon.

  • Fyller det polygonala området på skärmen.

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

Kommentarer

Varannat på varandra följande punkter i matrisen anger en sida av polygonen. Om den sista punkten och den första punkten inte sammanfaller anger de dessutom polygonens slutsida.

Gäller för

FillPolygon(Brush, Point[])

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller det inre i en polygon som definieras av en matris med punkter som anges av Point strukturer.

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
Public Sub FillPolygon (brush As Brush, points As Point())

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
Point[]

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

Undantag

brush är null.

-eller-

points är null.

Exempel

Följande kodexempel är utformat för användning med Windows Forms och kräver PaintEventArgse, vilket är en parameter för händelsehanteraren Paint. Koden utför följande åtgärder:

  • Skapar en helblå pensel.

  • Skapar en matris med sju punkter för att definiera en polygon.

  • Fyller det polygonala området på skärmen.

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

Kommentarer

Varannat på varandra följande punkter i matrisen anger en sida av polygonen. Om den sista punkten och den första punkten inte sammanfaller anger de dessutom polygonens slutsida.

Gäller för

FillPolygon(Brush, ReadOnlySpan<PointF>)

Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs
Källa:
Graphics.cs

Fyller den inre av en polygon som definieras av en matris med punkter som anges av strukturer med hjälp av Point det angivna fyllningsläget.

public:
 void FillPolygon(System::Drawing::Brush ^ brush, ReadOnlySpan<System::Drawing::PointF> points);
public void FillPolygon(System.Drawing.Brush brush, scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.FillPolygon : System.Drawing.Brush * ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub FillPolygon (brush As Brush, points As ReadOnlySpan(Of PointF))

Parametrar

brush
Brush

Brush som avgör fyllningens egenskaper.

points
ReadOnlySpan<PointF>

Matris med Point strukturer som representerar hörnen i polygonen som ska fyllas.

Gäller för