首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请问关于Brush的有关问题

2012-09-01 
请教关于Brush的问题我要在一个画板上画两个不同颜色的圆,应该怎么做呢?在for循环里不能new Brush吗?打个

请教关于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
[解决办法]
你两个圆不能画在同一个位置,不然第一个看不到了。
[解决办法]
看不懂。
[解决办法]

探讨

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

热点排行