title: How to save an image from a picturebox to jpg
body: <p>I have been able to save a file as a .jpeg, but the image won't load, has anyone got a suggestion?</p>
  
  <pre><code>    Private Sub Btnconfirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnconfirm.Click
  
          MsgBox("A receipt will now be saved to your files", vbOKOnly, "Thank you for your purchase")
  
          SaveFileDialog1.ShowDialog()
          MsgBox("Thank you for choosing Tiny Theatre, have a nice day.", vbOKOnly, "Thank you")
          Me.Close()
      End Sub
  
      Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
          Dim FileToSaveAs As String = SaveFileDialog1.FileName
  
          Dim objwriter As New System.IO.StreamWriter(FileToSaveAs)
          objwriter.Write(PictureBox1)
          objwriter.Close()
      End Sub
  </code></pre>