So I've been trying to create image files from the current game window (a screenshot essentially) but what I've tried so far just isn't working. The methods RenderTarget2D.SaveAsPng()
and RenderTarget2D.SaveAsJpeg()
aren't implemented yet by the MonoGame developers to use for Windows...
So I'm wondering, is there an alternative?
Here's a sample code that, when run, throws the NotImplemented error, for anyone curious:
Stream stream = new FileStream("screenshot.jpg", FileMode.Create, FileAccess.Write, FileShare.None);
screenshot.SaveAsJpeg(stream, 320, 180);
stream.Close();
The variable screenshot
is a RenderTarget2D
object where the game screen was drawn in.
Thanks for reading, I hope to get some help.