diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs index 7f6dd9ccf..338318177 100644 --- a/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs +++ b/Software/Visual_Studio/Tango.RemoteDesktop/Comparers/VectorBitmapComparer.cs @@ -17,6 +17,12 @@ namespace Tango.RemoteDesktop.Comparers public class VectorBitmapComparer : IBitmapComparer<VectorFrame> { /// <summary> + /// When max number of differences reached, the comparer will immediately return the current difference frame. + /// This should enforce the screen capture engine to report 'No Difference Available'. + /// </summary> + public long? MaxDifferencesThrow { get; set; } + + /// <summary> /// Creates the difference as <see cref="VectorFrame"/>. /// </summary> /// <param name="previousBitmap">The previous bitmap.</param> @@ -105,6 +111,13 @@ namespace Tango.RemoteDesktop.Comparers }); count++; + + if (MaxDifferencesThrow != null && count > MaxDifferencesThrow.Value) + { + previousBitmap.UnlockBits(data1); + currentBitmap.UnlockBits(data2); + throw new MaxDifferencesReachedException(); + } } } |
