There are some examples around of how to work with the WP7 camera apis, but I just wanted a nice and easy way of allowing the user to take a screen grab of the current game screen in my WP7 app.
This is nice code to hook off a ‘Save Screen’ app bar menu item for example.
Firstly, ensure you have explicitly requested permission to use the media library in your WMAppManifest.xml file, otherwise you will get nasties.
All you need to do is pass in the UIElement representing your screen (e.g. commonly a LayoutRoot Grid for example). I’ve hard coded the height, width and quality of the image, adjust as required.