title: Resize graphics to fit in PictureBox
body: <p>I need to draw a Fermat spiral in C#. I did it, but I want my drawing to be filled in PictureBox, no matter how big real size is.</p>
  
  <pre><code>  public void DrawSpiral(double delta, double numCycles, int oX, int oY, SpiralType spiralType, Color color, Graphics g)
    {
          double a = Convert.ToInt32(textBox1.Text);
          Pen p = new Pen(color, 1);
          double prevX = oX;
          double prevY = oY;
          double X = oX;
          double Y = oY;
          double fi = Convert.ToInt32(textBox2.Text); 
          double radius = 0;
  
          while (fi &lt;= (numCycles * 360))
          {
              fi += delta;
              if (spiralType == SpiralType.FermaPlus)
              {
                  radius = a * Math.Sqrt(fi); 
              }
              else if (spiralType == SpiralType.FermaMinus)
              {
                  radius = -a * Math.Sqrt(fi);
              }
              prevX = X;
              prevY = Y;
              X = (radius * Math.Cos(fi / 180 * Math.PI)) + oX;
              Y = (radius * Math.Sin(fi / 180 * Math.PI)) + oY;
              g.DrawLine(p, (float)prevX, (float)prevY, (float)X, (float)Y);
          }
      }
  
   private void DrawButton_Click(object sender, EventArgs e)
   {
          pictureBox1.Refresh();
          Graphics g = pictureBox1.CreateGraphics();
          DrawSpiral(2, 5, 150, 150, SpiralType.FermaPlus, Color.Blue, g);
          DrawSpiral(2, 5, 150, 150, SpiralType.FermaMinus, Color.Red, g);
    }
  </code></pre>
  
  <p>So, what should I do to have my drawing to be full filled in the PictureBox.</p>