想的是画了两条分开的直线,用DrawPath的时候自动把两条线的头尾连起来,能解决吗?

解决方案 »

  1.   

    这样?  GraphicsPath _Path = new GraphicsPath();
                _Path.AddLine(0, 0, 100, 100);
                _Path.AddLine(200, 200, 150, 50);            Graphics _Graphcis = Graphics.FromHwnd(this.Handle);            _Graphcis.DrawPath(new Pen(Brushes.Yellow), _Path);
                _Graphcis.Dispose();
      

  2.   

    要分开啊 那简单多了     GraphicsPath _Path = new GraphicsPath(FillMode.Alternate);            
                _Path.AddLine(0, 0, 100, 100);
                _Path.CloseFigure();            _Path.AddLine(200, 200, 150, 50);            Graphics _Graphcis = Graphics.FromHwnd(this.Handle);            
                _Graphcis.DrawPath(new Pen(Brushes.Yellow), _Path);
                _Graphcis.Dispose(); 
      

  3.   

    应该是用StartFigure()吧,但是好像要在每次Add后都要加这个方法啊