private static void RecieveImage()
        {
            Image screenshot = (Image)DesktopScreen.DeserializeScreen(netStream);

            OnEventImageRecieved(new ServerEventArgs()
            {
                Image = screenshot
            });
        }
Exemplo n.º 2
0
        private static void SendTransmission()
        {
            while (isOnline)
            {
                try
                {
                    binaryWriter.Write(CommandImage);
                    binaryWriter.Flush();
                    Bitmap screenshot = DesktopScreen.CaptureScreen(true);

                    DesktopScreen.SerializeScreen(netStream, screenshot);

                    netStream.Flush();
                }
                catch (Exception e)
                {
                    isOnline = false;
                }

                Thread.Sleep(10);
            }
        }