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

请教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();