读书人

请教GraphicsPath 的有关问题

发布时间: 2011-12-26 23:09:58 作者: rapoo

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

读书人网 >C#

热点推荐