Rectangle bounds = Screen.GetBounds(Point.Empty);
using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
using(Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
}
bitmap.Save(@ "C:\Cjob\test.jpg", ImageFormat.Jpeg);
}This code demonstrates how to get a screen shot of the entire desktop, or a particular window, using .NET(and a few API functions).
