Web自动截图功能!求大神帮忙!
protected void Page_Load(object sender, EventArgs e)
{
this.CreateImage();//这个是画图功能
this.Cutpicture();//这个是截图功能
}
private void Cutpicture()
{
Rectangle R = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
R.Width = 540;
R.Height = 400;
System.Drawing.Image img = new Bitmap(R.Width, R.Height);
Graphics G = Graphics.FromImage(img);
G.CopyFromScreen(new Point(0,86), new Point(0, 0), new Size(R.Width, R.Height));
IntPtr dc = G.GetHdc();
G.ReleaseHdc(dc);
G.Dispose();
img.Save("c:\\a.jpg");
}
$(document).ready(function () {
$.ajax
({
type: "GET",
url: "xxx.aspx/Cutpicture",
beforeSend: function () {
alert('正在加载');
},
success: function (data) {
alert('加载完成');
}
});
});