aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 21:32:42 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-04 21:32:42 +0200
commitf17d39f37cac50861467e07a7bee40534d20100a (patch)
tree1d6ba97191b866eee6ffc6ef904fe3803a84decd /Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs
parent565e48de649d3d14e6b82012b6aa2e3819a3c82c (diff)
downloadTango-f17d39f37cac50861467e07a7bee40534d20100a.tar.gz
Tango-f17d39f37cac50861467e07a7bee40534d20100a.zip
Improved "Notify Continuous Requests About Disconnection".
Integrated FSE/PPC Remote Desktop. Implemented RemoteDesktopService / RemoteDesktopProvider. Implemented Mouse/Keyboard gestures.
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs')
-rw-r--r--Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs b/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs
index 81efb6a30..8920b983b 100644
--- a/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs
+++ b/Software/Visual_Studio/Tango.RemoteDesktop/ScreenCaptureEngine.cs
@@ -111,7 +111,6 @@ namespace Tango.RemoteDesktop
if (IsStarted)
{
IsStarted = false;
- _previousBitmap?.Dispose();
}
}
@@ -180,15 +179,20 @@ namespace Tango.RemoteDesktop
catch (Exception ex)
{
Debug.WriteLine($"Error in screen capture engine: {ex.Message}");
+ _previousBitmap = null;
}
int delay = Math.Max(5, (1000 / FrameRate) - (int)watch.ElapsedMilliseconds);
Thread.Sleep(delay);
}
+
+ _previousBitmap = null;
}
private void OnFrameReceived(Bitmap currentBitmap, TFrame diffFrame, uint differenceCount)
{
+ if (!IsStarted) return;
+
FrameReceived?.Invoke(this, new ScreenCaptureFrameReceivedEventArgs<TFrame>()
{
Frame = new ScreenCaptureFrame<TFrame>(currentBitmap, diffFrame)