C# Graphics.DrawLine 画虚线

private void MainForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

{

//点的大小, 值一样则是画点

float[] BlueValues = {5, 15 20,25s};

//颜色及画笔大小设置

Pen BluekPen = new Pen(Color.Blue, 1);

//指定设定值

BluekPen.DashPattern = dashValues;

//画一条竖线

e.Graphics.DrawLine(BluekPen, new Point(20, 50), new Point(20, 150));

 }

posted @ 2012-03-09 12:25  Mr.Tom  阅读(6746)  评论(0编辑  收藏  举报