title: How to save a picture in WPF application
body: <p>Goal:<br>
  Save a picture from the harddrive into my WPF application. The picture should be available if copying the WPF application. The address to the picture located in the WPF application should be saved in the database.</p>
  
  <p>Problem:<br>
  How should I do it in a course of action?</p>
  
  <pre><code>private void btnBrowse_Click(object sender, RoutedEventArgs e)
  {
      Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
  
      dlg.Filter = "jpg files (*.jpg)|*.jpg|gif files (*.gif)|*.gif|jpeg files (*.jpeg)|*.jpeg";
  
      Nullable&lt;bool&gt; result = dlg.ShowDialog();
  
      if (result == true)
      {
          // Open document
          string filename = dlg.FileName;
  
          txtPicture.Text = filename;
  
          BitmapImage myBitmapImage = new BitmapImage(new Uri(dlg.FileName, UriKind.Absolute));
          string sss = myBitmapImage.Format.ToString();
          string asd = dlg.SafeFileName.ToString();
      }
  }
  </code></pre>