Texture2D.SaveAsJpeg works incorrectly on Windows Phone 8

I tried to save a texure to isolated storage as an image but it doesn’t work correctly. Here’s my code :

using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{
    using (var ifs = new IsolatedStorageFileStream("result.jpg", FileMode.Create, isf))
    {
        var texture = CGlobal.Content.Load<Texture2D>("textures\\pattern");
        texture.SaveAsJpeg(ifs, texture.Width, texture.Height);
    }
} 

Original texture

This is what I got

I’ve just tried this in XNA and it works correctly. So, it means the implementation of Texture2D.SaveAsJpeg in MonoGame has problem.

See my comment regarding this on GitHub.

1 Like