From c58b96e0884534fa1575239386cd99a4c9150d9d Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 28 Apr 2017 07:23:20 +0300 Subject: [PATCH] Use static ants border instead of blinking border for non active regions --- .../Forms/RegionCaptureForm.cs | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs index ddf12c8d3..ccee9ab35 100644 --- a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs @@ -83,13 +83,12 @@ public Color CurrentColor private TextureBrush backgroundBrush, backgroundHighlightBrush; private GraphicsPath regionFillPath, regionDrawPath; - private Pen borderPen, borderDotPen, textOuterBorderPen, textInnerBorderPen, markerPen; + private Pen borderPen, borderDotPen, borderDotStaticPen, textOuterBorderPen, textInnerBorderPen, markerPen; private Brush nodeBackgroundBrush, textBackgroundBrush; private Font infoFont, infoFontMedium, infoFontBig; private Stopwatch timerStart, timerFPS; private int frameCount; private bool pause, isKeyAllowed; - private ColorBlinkAnimation borderColorAnimation; private RectangleAnimation regionAnimation; private Bitmap bmpBackgroundImage; @@ -107,13 +106,6 @@ public RegionCaptureForm(RegionCaptureMode mode) DrawableObjects = new List(); timerStart = new Stopwatch(); timerFPS = new Stopwatch(); - borderColorAnimation = new ColorBlinkAnimation() - { - FromColor = Color.FromArgb(30, 30, 30), - ToColor = Color.FromArgb(100, 100, 100), - Duration = TimeSpan.FromMilliseconds(1500) - }; - borderColorAnimation.Start(); regionAnimation = new RectangleAnimation() { Duration = TimeSpan.FromMilliseconds(250) @@ -121,6 +113,7 @@ public RegionCaptureForm(RegionCaptureMode mode) borderPen = new Pen(Color.Black); borderDotPen = new Pen(Color.White) { DashPattern = new float[] { 5, 5 } }; + borderDotStaticPen = new Pen(Color.White) { DashPattern = new float[] { 5, 5 } }; nodeBackgroundBrush = new SolidBrush(Color.White); infoFont = new Font("Verdana", 9); infoFontMedium = new Font("Verdana", 12); @@ -474,13 +467,8 @@ private void Draw(Graphics g) } } - // Blink borders of all regions slightly to make non active regions to be visible in both dark and light backgrounds - borderColorAnimation.Update(); - - using (Pen blinkBorderPen = new Pen(borderColorAnimation.CurrentColor)) - { - g.DrawPath(blinkBorderPen, regionDrawPath); - } + g.DrawPath(borderPen, regionDrawPath); + g.DrawPath(borderDotStaticPen, regionDrawPath); } // Draw effect shapes @@ -1195,6 +1183,7 @@ protected override void Dispose(bool disposing) if (backgroundHighlightBrush != null) backgroundHighlightBrush.Dispose(); if (borderPen != null) borderPen.Dispose(); if (borderDotPen != null) borderDotPen.Dispose(); + if (borderDotStaticPen != null) borderDotStaticPen.Dispose(); if (nodeBackgroundBrush != null) nodeBackgroundBrush.Dispose(); if (infoFont != null) infoFont.Dispose(); if (infoFontMedium != null) infoFontMedium.Dispose();