using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace WindowsApplication4
{
public partial class Form1 : Form
{
Image I; Graphics G;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
I = new Bitmap(Screen.PrimaryScreen.Bounds.Size.Width, Screen.PrimaryScreen.Bounds.Size.Height);
G = Graphics.FromImage(I);
G.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);//注意:鼠标是不被捕捉的。G.Save();
I.Save("d://图.jpg", ImageFormat.Jpeg);
}
}
}