From 565e48de649d3d14e6b82012b6aa2e3819a3c82c Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 4 Mar 2020 14:09:45 +0200 Subject: Improved BitmapCliper. Implemented auto throw when max differences reached. Implemented fallback TurboJpeg encoder. Fixed issue with UpdateMachine.xml script removing DISPENSERS before IDS_PACKS. Added GlobalHost.Configuration.MaxIncomingWebSocketMessageSize for WebSockets support for large messages on SignalR. --- .../Tango.RemoteDesktop/ScreenCaptureEngine.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs') diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs b/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs index 17f54369c..81efb6a30 100644 --- a/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs +++ b/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs @@ -157,10 +157,19 @@ namespace Tango.RemoteDesktop } else { - var result = Comparer.CreateDifference(_previousBitmap, bitmap); - _previousBitmap.Dispose(); - _previousBitmap = bitmap.Clone() as Bitmap; - OnFrameReceived(bitmap, result.Frame, result.DifferenceCount); + try + { + BitmapComparerResult result = Comparer.CreateDifference(_previousBitmap, bitmap); + _previousBitmap.Dispose(); + _previousBitmap = bitmap.Clone() as Bitmap; + OnFrameReceived(bitmap, result.Frame, result.DifferenceCount); + } + catch (MaxDifferencesReachedException) + { + _previousBitmap.Dispose(); + _previousBitmap = bitmap.Clone() as Bitmap; + OnFrameReceived(bitmap, null, (uint)(bitmap.Width * bitmap.Height)); + } } } else -- cgit v1.3.1