static void Main() { Console.Write("Enter IP Address : "); var strIPAddress = Console.ReadLine(); Console.Write("Enter Port : "); var strPort = Console.ReadLine(); var port = int.Parse(strPort); var publisher = new TcpSocketClient(8000); publisher.Connect(new IPEndPoint(IPAddress.Parse(strIPAddress), port)); var dCapture = new DesktopCapture(PixelFormat.Format24bppRgb, new Size(640, 400)); var ss = new SocketStorage(publisher, dCapture); Console.WriteLine("Press Enter To Start streaming...."); Console.ReadLine(); Console.WriteLine("Press any Key To Exit...."); while (_kbhit() == 0) { var frame = dCapture.Execute(); ss.Process(frame); } }
public void ShouldCaptureDesktopImage() { var command = new DesktopCapture(PixelFormat.Format24bppRgb, new Size(704, 576)); var frame = command.Execute(); Assert.IsNotNull(frame); Assert.AreEqual(576, frame.Height); Assert.AreEqual(704, frame.Width); }