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

请教GraphicsPath 的有关问题

2011-12-26 
请教GraphicsPath 的问题我想画几个同样的不规则图形.想用数组来实现. GraphicsPath [] pathnewGraphicsP

请教GraphicsPath 的问题
我想画几个同样的不规则图形.想用数组来实现. GraphicsPath [] path=new GraphicsPath[2];
  int i=0;
  while(i<2)
  {
  path[i].AddLine(x1+i*100, y1, x2+i*100, y2);
  path[i].AddLine(x2+i*100, y2,x3+i*100, y3);
  path[i].AddLine(x3+i*100, y3,x4+i*100, y4);
  path[i].CloseFigure();
  }

private void Form1_MouseDown(object sender, MouseEventArgs e)
  {
   
  if (path[0].IsVisible(new Point(e.X, e.Y)))
  {
  *************
  }
   
  }







但这样不对.想请教一下,如何能实现.

[解决办法]
while体内的第一行:
path[i]=new GraphicsPath();

热点排行