c# brushes涂颜色的问题
来源:百度知道 编辑:UC知道 时间:2024/05/29 18:26:41
我用FillPath(Brushes.Blue, path),FillPath(Brushes.Red, path)等方法对一些彼此相邻的封闭多边形涂上不同的颜色。但是最后所有的多边形都变成同样的颜色了,这是为什么?
fillpath方法是用Graphics类型实例化调用的……为什么不行?
各位!请回答!拜托!
fillpath方法是用Graphics类型实例化调用的……为什么不行?
各位!请回答!拜托!
Graphics..::.FillPath 方法
填充 GraphicsPath 的内部。
public void FillPathEllipse(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create graphics path object and add ellipse.
GraphicsPath graphPath = new GraphicsPath();
graphPath.AddEllipse(0, 0, 200, 100);
// Fill graphics path to screen.
e.Graphics.FillPath(redBrush, graphPath);
}
要不你这样看看
Graphics g = this.CreateGraphics();
Brush t=new SolidBrush(Color.Red);
g.FillPath(t,??);
g