diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-04 14:09:45 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-04 14:09:45 +0200 |
| commit | 565e48de649d3d14e6b82012b6aa2e3819a3c82c (patch) | |
| tree | 16e766f6bd45e62c48d6046a21841526aafaed73 /Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs | |
| parent | b0ccae10fa6025838195c42fa6c9dd72b4321579 (diff) | |
| download | Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.tar.gz Tango-565e48de649d3d14e6b82012b6aa2e3819a3c82c.zip | |
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.
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs | 17 |
1 files changed, 13 insertions, 4 deletions
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<TFrame> 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 |
