|
Posted by jp2msft on June 19, 2008, 10:16 am
Please log in for more thread options
Does anyone have some code they could share on how to do a screen capture on
a Pocket PC or Windows Mobile device using Visual Studio 2005 (i.e Managed
Code)?
I wrote code to do it once before using eMbedded VC, but very little of this
will port over.
I've got working code for C# WinForms, except that it uses SendKeys.
Unfortunately, SendKeys is not a part of the Compact Framework.
Here's my code, if it helps:
[c# code]
private Bitmap m_bmp;
public Bitmap PrintScreen()
{
SendKeys.SendWait("%%"); // SendKeys is not defined!
IDataObject ido = Clipboard.GetDataObject();
if (ido.GetDataPresent(DataFormats.Bitmap) == true)
{
m_bmp = (Bitmap)ido.GetData(DataFormats.Bitmap);
string filename = "Bitmap_"
+ DateTime.Now.ToFileTimeUtc().ToString()
+ ".bmp";
m_bmp.Save(filename, Imaging.ImageFormat.Bmp);
}
}
[/c# code]
I'm trying to create tutorials for my CE Apps, and it would sure be nice if
I could write screen capturing calls in my code whenever key events happen.
Thanks for any help! (this is a duplicate post, but I've received no answer
from the sister group that I posted in earlier)
|