我想截图 : 在TextBox中输入文字   图片框加载图片  然后一起截图出来  保存

解决方案 »

  1.   

            /// <summary>
            /// 名称:GetImage
            /// 功能:截图函数
            /// 编写人:*****
            /// 编写时间:2008-12-11
            /// </summary>
            private void GetImage()//打印屏幕
            {
                try
                {
                    string tempImagePath = Application.StartupPath;
                    string temp = tempImagePath + "\\MonitorImage";
                    Directory.CreateDirectory(@temp);
                    Image i = new Bitmap(this.Width, this.Height);
                    Graphics g = Graphics.FromImage(i);
                    g.CopyFromScreen(new Point(this.Location.X, this.Location.Y), new Point(0, 0), new Size(this.Width, this.Height));
                    i.Save(@temp + "\\" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + ".jpg");
                    g.Dispose();
                    CommonClass.MessageBoxOK("截图成功!");
                }
                catch
                {
                    CommonClass.MessageBoxNo("截图失败!");
                }
            }
      

  2.   

    越来越发现c#好像很好使用win的实用api