コード例 #1
0
    // Use this for initialization
    void Start()
    {
        windowShader   = Shader.Find("WinCapture/WindowShader");
        desktopShader  = Shader.Find("WinCapture/DesktopShader");
        chromiumShader = Shader.Find("WinCapture/ChromiumShader");

        windowsRendering               = new Dictionary <IntPtr, WindowCapture>();
        windowObjects                  = new Dictionary <IntPtr, GameObject>();
        captureManager                 = new WindowCaptureManager();
        captureManager.OnAddWindow    += OnAddWindow;
        captureManager.OnRemoveWindow += OnRemoveWindow;
        lastUpdateTime                 = Time.time;
        lastPollWindowsTime            = Time.time;



        int displayNum = 0;

        desktopCapture1 = new DesktopCapture(displayNum);

        desktopObject      = GameObject.CreatePrimitive(PrimitiveType.Plane);
        desktopObject.name = "desktop" + displayNum;
        desktopObject.transform.GetComponent <Renderer>().material = new Material(desktopShader);
        desktopObject.transform.localEulerAngles = new Vector3(90, 0, 0);

        chromiumCapture = new ChromiumCapture(1024, 1024, "http://google.com");

        chromiumObject      = GameObject.CreatePrimitive(PrimitiveType.Plane);
        chromiumObject.name = "chromium capture";
        chromiumObject.transform.GetComponent <Renderer>().material = new Material(chromiumShader);
        chromiumObject.transform.localEulerAngles = new Vector3(90, 0, 0);
    }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public SocketStorage(TcpSocketClient client, DesktopCapture desktopCapture)
 {
     parser = new RdapMessageParser(parserStream);
     this.client = client;
     this.desktopCapture = desktopCapture;
     this.client.OnDataRecieved += OnDataRecieved;
 }
コード例 #4
0
        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);
        }