ScreenCapture

A class that will help you take screenshots quickly and easily.

Following are the features of this class:

  • Take screenshot of the whole screen
  • Take screenshot of a particular area using a Rectangle
  • Copy the screenshot to Clipboard.
  • Save the screenshot straight after it is captured.
  • All popular image formats are supported.

How to use?

To import this class into your C# project all you have to do is to drag and drop the “ScreenCapture.cs” file into your project.

It is very simple to use this class. Here’s an overview of all the features:

// Add this code to the top of your code
// i.e: add it above "public Form1() { ......"

SC.ScreenCapture SC = new SC.ScreenCapture();

// To take a screenshot of the whole screen
// Use this code:

SC.CaptureScreen();

// If you want to save the screenshot straight after it is taken
// Use this code:
// Replace "C:\\screenshot.jpg" with your own path

SC.CaptureScreen(@"C:\screenshot.jpg");

// To take screenshot of a particular area
// Use this code:
// Replace "Rect" with a Rectangle

SC.CaptureRectangle(Rect);

// To save the screenshot straight after it is taken
// Use this code:
// Replace "C:\screenshot-rect.jpg" with your own path and "Rect" with a rectangle.

SC.CaptureRectangle(Rect, "C:\\screenshot-rect.jpg");

// Note: Use the code below after you've taken a screenshot.
// To copy the screenshot to Clipboard
// Use this code

SC.CopyToClipboard();

The above instructions showed you all the features this class offers. However, if you want to see this class in acton. Then I’ve made a simple application for you, which uses this class. Download the class alone or the sample application below:

Dowload the ScreenCapture class and a sample application

ScreenCapture Class – Download Now (1 Kb)

Sample Application – Download Now (46 Kb)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • Reddit
  • Yahoo! Buzz
  • StumbleUpon
  • LinkedIn
  • Twitter