title: How to draw a zigzag line?
body: <p>I am creating a document based application and i want to draw a horizontal line underlying the text. But, line should not be straight. i want to draw a line like this.<br>
  <img src="https://i.stack.imgur.com/4pRlM.jpg" alt="Zigzag line"></p>
  
  <p>Currently i am using <code>System.Graphics</code> object to draw any object. </p>
  
  <pre><code>private void DrawLine(Graphics g, Point Location, int iWidth)
  {
      iWidth = Convert.ToInt16(iWidth / 2);
      iWidth = iWidth * 2;
      Point[] pArray = new Point[Convert.ToInt16(iWidth / 2)];
      int iNag = 2;
      for (int i = 0; i &lt; iWidth; i+=2)
      {
          pArray[(i / 2)] = new Point(Location.X + i , Location.Y + iNag);
          if (iNag == 0)
              iNag = 2;
          else
              iNag = 0;
      }
      g.DrawLines(Pens.Black, pArray);
  }
  </code></pre>
  
  <p><strong>UPDATED</strong>:<br>
  Above code is working fine and line draws perfectly but, this code effects on application performance. Is there another way to do this thing.</p>