C#-屏幕截图

阅读 127

2022-07-18

public static Bitmap GetImgDesk()
{
Rectangle rect = System.Windows.Forms.SystemInformation.VirtualScreen;
//获取屏幕分辨率
int x_ = rect.Width;
int y_ = rect.Height;
//截屏
Bitmap img = new Bitmap(x_, y_);
Graphics g = Graphics.FromImage(img);
g.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(x_, y_));
return img;
}




精彩评论(0)

0 0 举报