做波形特效主要调用Graphics类中的DrawLine和DrawBezier方法,要用到System.Drawing.Drawing2D命名空间
具体化代码如下:
Graphics graphics = this.CreateGraphics();//创建Graphic对象
Pen myPen = new Pen(Color.Blue, 2);int beginX = 50;
int beginY = 65;
int height = 35;
int width = 50;
Point pointX1 = new Point(beginX, beginY);
Point pointY1 = new Point(beginX + 200, beginY);
Point pointX2 = new Point(beginX, beginY - 60);
Point pointY2 = new Point(beginX, beginY + 60);
graphics.DrawLine(myPen,pointX1,pointY1);//调用DrawLine方法绘制
graphics.DrawLine