private void YcLj_Load(object sender, EventArgs e) { this.Text = "正在与:" + xz + "通信!"; my_PictureBoxImg = new A_SetPictureBoxImg(SetPictureBoxImgm); /* * int screenWidth = System.Windows.Forms.SystemInformation.VirtualScreen.Width; //屏幕宽度 * int screenHeight = System.Windows.Forms.SystemInformation.VirtualScreen.Height; //屏幕高度 * * //创建图象,保存将来截取的图象 * Bitmap image = new Bitmap(screenWidth, screenHeight); * Graphics imgGraphics = Graphics.FromImage(image); * //设置截屏区域 * imgGraphics.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight), CopyPixelOperation.SourceCopy); * imgGraphics.Dispose(); * * //Byte[] bbb = PhotoImageInsert(image); * * //Image y = BytesToImage(bbb); * * //this.pictureBox1.Image = y; * * * this.pictureBox1.Image = image; */ IPEndPoint hostEntry = new IPEndPoint(IPAddress.Any, 18179); YcljPort.Bind(hostEntry); //开始监听 YcljPort.Listen(10); Thread tt = new Thread(new ThreadStart(Cgzs)); tt.IsBackground = true; tt.Start(); }
private void YcLj_Load(object sender, EventArgs e) { this.Text = "正在与:" + xz + "通信!"; my_PictureBoxImg = new A_SetPictureBoxImg(SetPictureBoxImgm); /* int screenWidth = System.Windows.Forms.SystemInformation.VirtualScreen.Width; //屏幕宽度 int screenHeight = System.Windows.Forms.SystemInformation.VirtualScreen.Height; //屏幕高度 //创建图象,保存将来截取的图象 Bitmap image = new Bitmap(screenWidth, screenHeight); Graphics imgGraphics = Graphics.FromImage(image); //设置截屏区域 imgGraphics.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight), CopyPixelOperation.SourceCopy); imgGraphics.Dispose(); //Byte[] bbb = PhotoImageInsert(image); //Image y = BytesToImage(bbb); //this.pictureBox1.Image = y; this.pictureBox1.Image = image; */ IPEndPoint hostEntry = new IPEndPoint(IPAddress.Any, 18179); YcljPort.Bind(hostEntry); //开始监听 YcljPort.Listen(10); Thread tt = new Thread(new ThreadStart(Cgzs)); tt.IsBackground = true; tt.Start(); }