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); }
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); }
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); } }