mono/MonoGame — pull request #2029 by Strifex (2013-09-25 02:21:21+00:00)
Title: Corrected color bug with SaveAsJpeg on Windows Phone 8

Adjusted the Windows Phone 8 version of Texture2D's SaveAsJpeg class to
switch the pixels RGBA/BGRA values so that Writeablebitmap will read the
data correctly. Added helper function in Texture2D called ConvertToRGBA
to convert the pixel data. Images now save as properly colored JPEGs.

Note: This function will block permanently if called from the Main/UI thread. This happens because WriteableBitmap needs to be called from the UI thread and ManualResetEventSlim will pause the UI thread, called the dispatcher to invoke the UI thread when it ready...but the UI thread will never be ready because you just paused it! Therefore, this function can currently only be called from a background thread. (It was setup this way when I found it, and I couldn't think of a better solution so I left it). Also, this is my first commit to this project so if I did anything wrong/silly please let me know!