title: Converting Image to bitmap turns background black
body: <p>I need to convert an Image to a bitmap.</p>
  
  <p>initially a gif was read in as bytes and then converted to an Image.</p>
  
  <p>But when I try convert the image to a bit map, the graphic displaying in my picturebox has a black background when it used to be white.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    var image = (System.Drawing.Image)value;
          // Winforms Image we want to get the WPF Image from...
          var bitmap = new System.Windows.Media.Imaging.BitmapImage();
          bitmap.BeginInit();
          MemoryStream memoryStream = new MemoryStream();
          // Save to a memory stream...
          image.Save(memoryStream, ImageFormat.Bmp);
          // Rewind the stream...
          memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
          bitmap.StreamSource = memoryStream;
          bitmap.EndInit();
          return bitmap;
  </code></pre>
  
  <p>Can some one explain why the background is going black and how i can stop it doing this.</p>
  
  <p>Thanks</p>