画刷
以画一个椭圆为例:
Point startPoint = new Point(10, 10);
Point endPoint = new Point(200, 80);
Graphics g = this.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Red);
g.FillEllipse(brush,startPoint.X,startPoint.Y,endPoint.X,endPoint.Y);
g.Dispose();
上边代码定义了两个点,startPoint和endPoint,并定义了坐标,之后定义了绘画的地方g,定义画刷brush,并以两个点框出一个矩形,在此矩形中画一个红色填充的椭圆,并释放g的资源
Brush类的派生类:
改变画刷: