Reprinted from http://blog.csdn.net/lijgame/article/details/1447921
Using system;
Using system. Collections. Generic;
Using system. componentmodel;
Using system. Data;
Using system. drawing;
Using system. LINQ;
Using system. text;
Using system. Windows. forms;
Using system. Drawing. imaging;
Namespace first
{
Public partial class form2: Form
{
Public form2 ()
{
Initializecomponent ();
}
Private void button#click (Object sender, eventargs E)
{
// Obtain the resolution of the current screen
Screen scr = screen. primaryscreen;
Rectangle rc = scr. bounds;
Int iwidth = RC. width;
Int iheight = RC. height;
// Create a bitmap as large as the screen
Image myimage = new Bitmap (iwidth, iheight );
// Create a graphics object from an object inherited from the image class
Graphics G = graphics. fromimage (myimage );
// Capture the screen and copy it to myimage
G. copyfromscreen (new point (0, 0), new point (0, 0), new size (iwidth, iheight ));
// Save as an object
Myimage. Save ("1.jpg ");
}
}
}
C # enable full screen capture on the computer