 |
建站必读 |
 |
|
|
 |
|
 |
|
| |
| 当前位置:首页 -> 建站必读 -> .NET技术 |
|
有关图形方面的一篇文章,不妨一看 |
Working with Brushes in GDI+ Drawing GDI+ Objects
The following code draws a line, an ellipse, a curve, and a polygon object. As you can see from the code, I抳e used pen object to fill these objects. See more details.
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pn = new Pen(Color.Green, 10);
g.DrawLine(pn, 100, 10, 30, 10);
g.DrawEllipse( new Pen(Color.Red, 20), 20, 40, 20, 20);
g.DrawBezier( new Pen(Color.Blue, 5), new Point(50,60), new
Point(150,10), new Point(200,230), new Point(100,100) );
PointF point1 = new PointF(50.0f, 250.0f);
PointF point2 = new PointF(100.0f, 25.0f);
PointF point3 = new PointF(150.0f, 5.0f);
PointF point4 = new PointF(250.0f, 50.0f);
PointF point5 = new PointF(300.0f, 100.0f);
PointF[] curvePoints = {point1, point2, point3, point4, point5 };
g.DrawPolygon(new Pen(Color.Chocolate, 10), curvePoints);
}
|
| |
|
| |
本站关键词: |
|
|
|
|
 |
|
 |
|
|