I'm quite new to the world of programing and have an issue with trying to do a print screen of my program (saving to my desktop as a png) the closest I've gotten to it is to manage to save a screenshot of my entire screen.
The coding I've used is as follows:
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);
And I can't figure out if there's any way to do what I want it to.
Any help greatly appreciated.