Ejemplo n.º 1
0
 private void UpdateFrameBufferSize(int width, int height, bool requestWindowResize = false)
 {
     width  = Math.Max(width, 10);
     height = Math.Max(height, 10);
     FrameBuffer.SetBuffer(width, height);
     FrameBufferHandler.OnFrameBufferResized(width, height, width, FrameBuffer.Buffer, requestWindowResize);
 }
Ejemplo n.º 2
0
        private void ReportDisconnection()
        {
            // Draw a blank control - show we're disconnected (omit this call to keep the last image on screen)
            FrameBufferHandler.OnFrameBufferResized(0, 0, 0, null, false);

            // And pass on to the caller's disconnect routine.
            OnDisconnect.Invoke(DisconnectReason, DisconnectFlags);
        }
Ejemplo n.º 3
0
        private void OnServerFbSizeChanged(Viewer viewer, int w, int h)
        {
            // The Server screen size has changed, so we signal the window to
            // resize to match its aspect ratio.

            ServerAspectRatio = w / (double)h;
            w = viewer.GetViewerFbWidth();
            h = (int)(w / ServerAspectRatio);

            FrameBuffer.SetBuffer(w, h);

            // Before we pass it onto the frame-buffer-handler check we have correctly applied the resize to our
            if (!UpdateFrameBufferToCanvasSize())
            {
                FrameBufferHandler.OnFrameBufferResized(w, h, w, FrameBuffer.Buffer, true);
            }
        }
Ejemplo n.º 4
0
 private void OnViewerFbUpdated(Viewer viewer, int x, int y, int w, int h)
 {
     // The Server has sent fresh pixel data, so we redraw the specified part of the form
     FrameBufferHandler.OnFrameBufferUpdated(new Rect(x, y, w, h));
 }