1

我对编程世界很陌生,并且在尝试打印我的程序的屏幕时遇到问题(以 png 格式保存到我的桌面)我最接近它的是设法保存我的屏幕截图整个屏幕。

我使用的编码如下:

Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Height, Screen.PrimaryScreen.Bounds.Width);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.s);
printscreen.Save(@"C:\Payroll\" + txtName.Text + "_Payroll_" + dateTimePicker1.Text + ".png", ImageFormat.Png);

而且我不知道是否有任何方法可以做我想做的事。

非常感谢任何帮助。

4

0 回答 0