Example #1
0
        // Fired when the IVirtualMachineController sends a new display chunk.
        public void OnDisplayUpdate(object sender, DisplayUpdateArgs e)
        {
            foreach (User u in users)
            {
                if (!u.connected)
                {
                    continue;               // F**K
                }
                MemoryStream png = EncodeBitmapToPNG(e.displayData);

                u.ActionQueue.Enqueue(new Action
                {
                    inst = new string[] {
                        "rect", e.x.ToString(), e.y.ToString(), e.width.ToString(), e.height.ToString()
                    }
                });

                u.ActionQueue.Enqueue(new Action {
                    binaryData = png.ToArray()
                });

                png.Dispose();
            }
        }
 protected void OnDisplayUpdate(DisplayUpdateArgs e)
 {
     TestHvDispUpd?.Invoke(this, e);
 }