I've been working a lot on an old game that a few friends and I made in college. We ported it to C# using the XNA framework and it's working great! You can read more about that project by
clicking here.
The old code was C++ with OpenGL. One of the functions I had a hard time porting was taking a screenshot. Older versions of XNA seemed to have a way to do it, but the newest version, 4.0, didn't have an easy way to do it. Here's what I ended up doing:
public void ScreenShot(string prefix) {
#if WINDOWS
int w = GraphicsDevice.PresentationParameters.BackBufferWidth;
int h = GraphicsDevice.PresentationParameters.BackBufferHeight;
Draw(new GameTime());
int[] backBuffer = new int[w * h];
GraphicsDevice.GetBackBufferData(backBuffer);
Texture2D texture = new Texture2D(GraphicsDevice, w, h, false, GraphicsDevice.PresentationParameters.BackBufferFormat);
texture.SetData(backBuffer);
Stream stream = File.OpenWrite(prefix + "_" + Guid.NewGuid().ToString() + ".png");
texture.SaveAsPng(stream, w, h);
stream.Close();
#elif XBOX
throw new NotSupportedException();
#endif
}
Here's an article you can check out that explains the new behavior:
http://blogs.msdn.com/b/shawnhar/archive/2010/03/30/resolvebackbuffer-and-resolvetexture2d-in-xna-game-studio-4-0.aspx