C# 图片上画连线时 自定义两点间的划线段样式

Graphics g = this.pictureBox1.CreateGraphics();
Brush brush = new SolidBrush(Color.White);
Pen pen = new Pen(brush, 1);
//pen.DashStyle = DashStyle.Solid;//using System.Drawing.Drawing2D;
pen.DashPattern = new float[]{2,10};
pen.DashStyle = DashStyle.Custom;
g.DrawLine(pen,new Point(x1,y1),new Point(x2,y2));
g.Dispose();

posted on 2008-12-02 10:50  freeliver54  阅读(1918)  评论(0编辑  收藏  举报

导航