title: How to save a bitmap image as JPEG
body: <p>The problem is that the file is not saving as JPEG. Just a normal file.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>private void btnSave_Click(object sender, EventArgs e)
  {
      saveDialog.FileName = txtModelName.Text;
  
      if (saveDialog.ShowDialog() == DialogResult.OK)
      {
          Bitmap bmp = new Bitmap(pnlDraw.Width, pnlDraw.Height);
  
          pnlDraw.DrawToBitmap(bmp, new Rectangle(0, 0,
              pnlDraw.Width, pnlDraw.Height));
  
          bmp.Save(saveDialog.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);
      }
  }
  </code></pre>