How do i save the current frame/image in pictureBox1 to a bitmap file?
<p>In the top of Form1 i did: Bitmap bmp;
In the paint event im drawing to the pictureBox and also to the bmp file:</p>

<pre><code>private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            SolidBrush brush;
            Pen p=null;
           Point connectionPointStart;
           Point connectionPointEnd;
           Graphics g = e.Graphics;
           bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
           Graphics bitmapGraphics = Graphics.FromImage(bmp);
           //g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

               moveCounter++;
               label6.Text = moveCounter.ToString();

               brush = new SolidBrush(Color.Red);
               p = new Pen(brush);
               for (int idx = 0; idx &lt; wireObject1._point_X.Count; ++idx)
               {
                   Point dPoint = new Point((int)wireObject1._point_X[idx], (int)wireObject1._point_Y[idx]);
                   dPoint.X = dPoint.X - 5; // was - 2
                   dPoint.Y = dPoint.Y - 5; // was - 2
                   Rectangle rect = new Rectangle(dPoint, new Size(10, 10));
                   g.FillEllipse(brush, rect);
                   bitmapGraphics.FillEllipse(brush, rect);

                   // g.FillEllipse(brush, rect);
               }

               for (int i = 0; i &lt; wireObject1._connectionstart.Count; i++)
               {

                   int startIndex = wireObject1._connectionstart[i];
                   int endIndex = wireObject1._connectionend[i];



                   connectionPointStart = new Point((int)wireObject1._point_X[startIndex], (int)wireObject1._point_Y[startIndex]);
                   connectionPointEnd = new Point((int)wireObject1._point_X[endIndex], (int)wireObject1._point_Y[endIndex]);
                   p.Width = 2;
                   g.DrawLine(p, connectionPointStart, connectionPointEnd);
                   bitmapGraphics.DrawLine(p, connectionPointStart, connectionPointEnd);
               }

        }
</code></pre>

<p>I did a new instace in the paint event for the bmp file. I also make a new graphics variable for the bmp file. And every place i draw or fillellipse to the pictureBox i also draw it to the bmp file.</p>

<p>Now in the save function i did:</p>

<pre><code>private void SavePictureBoxToBitmap()
        {
            //PbToBitmap++;
            //String tempFile = @"d:\PictureBoxToBitmap\" + PbToBitmap.ToString("D6") + bmp;
            bmp.Save(@"d:\PictureBoxToBitmap\bit.bmp");
        }
</code></pre>

<p>If im doing bmp.Save it will save to the hard disk a white bmp file with the drawings inside only. If im doing pictureBox1.Image.Save it will save to the hard disk a file with the picture in the pictureBox only without the drawings.</p>

<p>How can i combine it so i will make one save line/command and it will create one bmp file on the hard disk with the pictureBox image and the drawings togeather ?</p>
