My code looks like this:
String filename = Utils.GetNextFilename();
MediaLibrary library = new MediaLibrary();
library.SavePicture(filename, corrected_image);
And in the SavePicture()
call, I get the following:
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.Xna.Framework.dll
Additional information: Value does not fall within the expected range.
But I'm not sure why.
Okay, I figured it out. I must reset the stream: