-3

I have a byte[] of image data (of png type) and I want to convert it into jpeg type image. What would be the best way of doing it in Windows Phone 8?

tavier
  • 1,744
  • 4
  • 24
  • 53
  • Check this link once.. http://stackoverflow.com/questions/8764280/c-sharp-image-to-byte-and-byte-to-image – Raghuveer Dec 03 '14 at 10:45

1 Answers1

1

Try this:

using(var stream = new MemoryStream(bytes))
{
   //bytes is byte[] containing the image data
   var image = Image.FromStream(stream);
   image.Save(File.OpenWrite("MyImage.jpeg", ImageFormat.Jpeg);
}
Ajay
  • 6,418
  • 18
  • 79
  • 130
Ricardo Peres
  • 13,724
  • 5
  • 57
  • 74