一、屏幕截图
Screen scr = Screen.PrimaryScreen;
Rectangle rc = scr.Bounds;
int iWidth = rc.Width;
int iHeight = rc.Height;
System.Drawing.Bitmap image = new Bitmap(iWidth, iHeight);
Graphics graph = Graphics.FromImage(image);
graph.CopyFromScreen(new Point(50, 520), new Point(40, 150), new Size(1320, 1400));
image.Save(@"C:\Users\admin\Pictures\" + "txqx" + ".jpeg");
二、控件截图
Bitmap image = new Bitmap(formsPlot3.Width, formsPlot3.Height);
formsPlot3.DrawToBitmap(image, formsPlot3.ClientRectangle);
image.Save(@"C:\Users\admin\Pictures\" + "txqx" + ".jpeg");