views:

294

answers:

3

I want to add the ability for the users to capture the current screen in my app and email it. I have a very non-technical user base so I need this to be as simple as possible. I plan to let them click a menu item called Help Me! which will then capture the current Application Screen, hopefully as a jpg or png, and then open Outlook and add the image as an attachment.

I was reading through this post ScreenCapture on Code Project but it is a little old and isn't exactly what I was looking for so I thought I would check if there is a better way of doing this.

How do I get started on this? Is there a library or are the built in capabilities enough?

Thanks!

+3  A: 

Check the Graphics.CopyFromScreen method.

CMS
+1  A: 

Take a look at this article

roman m
+11  A: 

That post you linked is the right approach, they just made it very complex. You would want to use Graphics.CopyFromScreen.

Rectangle bounds = this.Bounds;

using(Bitmap ss = new Bitmap(bounds.Width, bounds.Height))
using(Graphics g = Graphics.FromImage(ss))
{
  g.CopyFromScreen(this.Location, Point.Empty, bounds.Size);
  ss.Save("test.jpg", ImageFormat.Jpeg);
}
Samuel
small typo --> Line 4--> Graphics.FromImage(ss))Shiny!
Refracted Paladin
@Mr_Mom: Thanks, fixed.
Samuel