admin管理员组

文章数量:1558697

c# 截屏并保存为图像可以使用Graphics类的FromImage()方法,保存则用到Image类的Save方法,代码如下:

Screen a = Screen.PrimaryScreen;

Rectangle rc = a.Bounds;

int 宽 = rc.Width;

int 高 = rc.Height;

Image image = new Bitmap(iWidth, iHeight);

Graphics graph = Graphics.FromImage(image);

graph.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(宽,高));

image.Save(@"E:/截屏.jpeg");

本文标签: 最简单方法