Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 7 - Capture Screen

I am trying to capture the screen whilst my windows mobile application is running. I have this so far but I keep getting an ArgumentException of 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.

Update

I managed to make use the great tutorial suggested by Matt.

However, it doesn't seem to capture anything from the WebBrowser.

1) Does anyone know how the native email application renders HTML email - what component does it use?

2) What is used to create the native applications in the Windows Phone 7 series?

like image 326
Abs Avatar asked Oct 12 '11 15:10

Abs


People also ask

Does Windows 7 have screen capture?

Press Esc and then open the menu you would like to capture. Pres Ctrl+Print Scrn. Click on the arrow next to New and select Free-form, Rectangular, Window or Full-screen. Take a snip of the menu.

How do I take a screenshot instantly in Windows 7?

Depending on your hardware, you may use the Windows Logo Key + PrtScn button as a shortcut for print screen. If your device does not have the PrtScn button, you may use Fn + Windows logo key + Space Bar to take a screenshot, which can then be printed.

Can you screenshot on a Nokia Lumia?

To take a screenshot, open the notification panel and drag the status bar downwards. Tap Screen capture. You can view captured images in Photos. Alternative way to take a screenshot is pressing volume down and power button.


2 Answers

Here's another solution just published by Jeff Wilcox

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.

like image 171
Matt Lacey Avatar answered Oct 23 '22 09:10

Matt Lacey


Not sure on first inspection. The SaveJpeg params look okay, but not sure about the 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

like image 38
olan Avatar answered Oct 23 '22 10:10

olan