I am trying to take a screenshot of an XNA DrawingSurface subclass element from a silverlight 5 application. This sl application will work on an aspx page.
Here is what I have tried so far without success:
WriteableBitmap bmp = new WriteableBitmap(LayoutRoot, null); testImage.Source = bmp;
with LayoutRoot being the parent control on the silverlight page, and testImage is just the image control on the page to make sure the screenshot is correct.
This will allow you to fully control the silverlight controls on the page, but part of the drawing surface remains blank. In other words, XNA content is not displayed in the image.
I also tried displaying the contents of XNA in RenderTarget2D, but the Silverlight version for the render object does not seem to have methods for saving data. I saw some WP7 examples that used the SaveAsJpeg () method, but this does not seem to be available in the SL5 version of the class.
I would appreciate any help with this.
hello
Floris
Floris groen
source share