hozuki / MonoGame.Extended2

A collection of extensions for MonoGame
BSD 3-Clause Clear License
38 stars 8 forks source link

[Feature Requests] Screenshot #5

Closed Aloento closed 2 years ago

Aloento commented 3 years ago

Ever considered packing a MonoGame screenshot feature?

hozuki commented 3 years ago

Maybe. I wrote a screenshot implementation before. It basically does these:

  1. switch to another render target (such as a Texture2D);
  2. render current frame again;
  3. switch back to the original render target;
  4. save the contents in the render target to somewhere.

It's not that complicated. After getting the raw image data it's up to you to decide how to deal with it. In the old days SaveAsPng() didn't work so I copy the data to a System.Drawing.Bitmap (mind the color components!) to do the saving.