C# 如何获取屏幕的截图,以及如何在图像上添加文字

关键代码为

            Screen sc = Screen.PrimaryScreen;
            Rectangle rct = sc.Bounds;
            Image img = new Bitmap(rct.Width, rct.Height);
            Graphics gp = Graphics.FromImage(img);
            gp.CopyFromScreen(new Point(0, 0), new Point(0, 0), new Size(rct.Width, rct.Height));

            SolidBrush sb = new SolidBrush(Color.Red);
            Font ft = new System.Drawing.Font("黑体",16);

            gp.DrawString("这是什么",ft,sb,new PointF(0,rct.Height-ft.Height));
            
            
            
            
            img.Save(@"d:1.bmp");
原文地址:https://www.cnblogs.com/lujin49/p/3504808.html