截屏

            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));

            this.pictureBox1.Image = img;
View Code

 

posted @ 2015-10-27 09:21  西瓜子儿  阅读(129)  评论(0编辑  收藏  举报