Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Could anyone give me some information on how to screen capture on a Pocket PC or Windows Mobile device using Visual Studio (i.e Managed Code)?

 

I written code to do it in the past using eMbedded VC, but very little of this will port over to VS.

 

I've got working code for C# WinForms, except that it uses SendKeys (see code below). Unfortunately, SendKeys is not a part of the Compact Framework.

 

Here's the method I'm trying to make, if it helps:

private Bitmap m_bmp;
public Bitmap PrintScreen() 
{
 SendKeys.SendWait("%{PRTSC}%"); // 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);
 }
}

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.

 

Is there an alternative to capturing the screen to the Clipboard besides SendKeys?

 

Thanks for any help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...