繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> 报表/图形/Office >> 有关图形方面的一篇文章,不妨一看

有关图形方面的一篇文章,不妨一看

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:22  文字大小:【】【】【
简介: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 objec...

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

}

责任编辑:admin
相关文章