简体   繁体   English

Windows Phone 7 - 捕获屏幕

[英]Windows Phone 7 - Capture Screen

I am trying to capture the screen whilst my windows mobile application is running. 我试图在我的Windows移动应用程序运行时捕获屏幕。 I have this so far but I keep getting an ArgumentException of The parameter is incorrect . 到目前为止我有这个,但我一直得到ArgumentException The parameter is incorrect What am I doing wrong? 我究竟做错了什么?

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;

The above is within my MainPage constructor. 以上是在我的MainPage构造函数中。

Update 更新

I managed to make use the great tutorial suggested by Matt. 我设法使用了Matt建议的精彩教程。

However, it doesn't seem to capture anything from the WebBrowser . 但是,它似乎没有捕获WebBrowser任何内容。

1) Does anyone know how the native email application renders HTML email - what component does it use? 1)有没有人知道本机电子邮件应用程序如何呈现HTML电子邮件 - 它使用什么组件?

2) What is used to create the native applications in the Windows Phone 7 series? 2)用于在Windows Phone 7系列中创建本机应用程序的内容是什么?

Here's another solution just published by Jeff Wilcox 这是Jeff Wilcox刚刚发布的另一种解决方案

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

It captures screenshots at intervals you specify and then saves them to IsolatedStorage. 它会按您指定的时间间隔捕获屏幕截图,然后将其保存到IsolatedStorage。

Not sure on first inspection. 第一次检查时不确定。 The SaveJpeg params look okay, but not sure about the WritableBitmap .. SaveJpeg参数看起来没问题,但不确定WritableBitmap ..

Check here for a code example: 点击此处查看代码示例:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM