public FillPolygon ( |
||
brush | ||
points | Point | |
fillMode | FillMode | |
return | void |
private void Form1_Paint(object sender, PaintEventArgs e) { Point[] points = { new Point(50, 50), new Point(100, 100), new Point(0, 100) }; Brush brush = new SolidBrush(Color.Blue); e.Graphics.FillPolygon(brush, points); }
private void Form1_Paint(object sender, PaintEventArgs e) { Point[] points = { new Point(50, 50), new Point(100, 10), new Point(150, 50), new Point(125, 100), new Point(75, 100) }; Brush brush = new LinearGradientBrush(new Point(0, 0), new Point(0, 100), Color.Blue, Color.White); e.Graphics.FillPolygon(brush, points); }This example uses the LinearGradientBrush to create a gradient brush from blue to white, which is used to fill the pentagon drawn using the Graphics.FillPolygon method. Both of these examples use the System.Drawing namespace, which is part of the .NET Framework library.
public FillPolygon ( |
||
brush | ||
points | Point | |
fillMode | FillMode | |
return | void |