Saturday, February 18, 2006

Screen capture tool

Screenshot of 'Screen Capture' I've written a little screen capture tool, for fun. You can download it from the sandbox at Channel 9. I did not include the source code, because there isn't a lot of it. Just use Reflector for that. Here's the bit of code that does the actual capturing and copying to the clipboard:
Rectangle region = ...; // the screen region to capture
using (Bitmap bitmap =
    new Bitmap(region.Width, region.Height, PixelFormat.Format32bppArgb))
using (Graphics bitmapGraphics = Graphics.FromImage(bitmap))
{
    bitmapGraphics.CopyFromScreen(region.Left, region.Top, 0, 0, region.Size);
    Clipboard.SetImage(bitmap);
}
EDIT: I've updated the tool: after capturing, you can now directly save the screenshot too.
Comments:
Hi Tommy, since I don't have your email address I'll use this comment. I just read your blog and found it quite ineteresting. On mine I'm about to create a "World Community", the idea is to have blogs from .net developers all around the world, so I'm contacting you to represent Belgium. You can ckecl out my blog at http://sgomez.blogspot.com and feel free to reach me at SebastianGomezCorrea{at}gmail.com
 
Amor Screen Capture is a tool for capturing any part of your screen. You can make professional screen shots and save them as bmp, png, pcx,tif,gif or jpg files.
 
Post a Comment

Links to this post:

Create a Link