日期:2014-05-18  浏览次数:20807 次

请教关于Brush的问题
我要在一个画板上画两个不同颜色的圆,应该怎么做呢?在for循环里不能new Brush吗?
  打个比方
  Graphics graphics = e.Graphics;
  Brush brush;
for(int i=0;i<2;i++)
{
if(i==0)
  brush = new SolidBrush(Color.Green);
else if(i==1)
brush = new SolidBrush(Color.Red);

  Graphics graphics = e.Graphics;
  Rectangle rect = new Rectangle(110, 10, 20, 20);
  graphics.FillRectangle(brush,rect);
}

我是新手,请各位大虾帮帮忙!


------解决方案--------------------
graphics.FillEllipse
------解决方案--------------------
你两个圆不能画在同一个位置,不然第一个看不到了。
------解决方案--------------------
看不懂。
------解决方案--------------------
探讨

你两个圆不能画在同一个位置,不然第一个看不到了。