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));

 }

转载于:https://www.cnblogs.com/mrtom/archive/2012/03/09/2387400.html

你可能感兴趣的:(C# Graphics.DrawLine 画虚线)