Windows Phone 7 – 捕获屏幕

我试图在我的Windows移动应用程序运行时捕获屏幕。 到目前为止我有这个,但我一直得到一个参数The parameter is incorrect的ArgumentException。 我究竟做错了什么?

 WriteableBitmap wb = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight); wb.Render(this, null); wb.Invalidate(); MemoryStream ms = new MemoryStream(); int h = 212; int w = 444; wb.SaveJpeg(ms, w, h, 0, 100); // The parameter is incorrect BitmapImage bitmapImage = new BitmapImage(); bitmapImage.SetSource(ms); image1.Source = bitmapImage; 

以上是在我的MainPage构造函数中。

更新

我设法使用了Matt建议的精彩教程。

但是,它似乎没有捕获WebBrowser任何内容。

1)有没有人知道本机电子邮件应用程序如何呈现HTML电子邮件 – 它使用什么组件?

2)用于在Windows Phone 7系列中创建本机应用程序的内容是什么?

这是Jeff Wilcox刚刚发布的另一个解决方案

http://www.jeff.wilcox.name/2011/10/screenshots-cs-how-to-capture-screenshots-of-your-app-on-your-device/

它会按您指定的时间间隔捕获屏幕截图,然后将它们保存到IsolatedStorage。

第一次检查时不确定。 SaveJpeg参数看起来没问题,但不确定WritableBitmap ..

点击此处查看代码示例:

http://geekswithblogs.net/lbugnion/archive/2010/12/28/taking-a-screenshot-from-within-a-silverlight-wp7-application.aspx