I have a simple panel that is used as a drawing surface. The goal is to, under certain circumstances, draw a 4-pixel outline around the child ListView. I would like to make the circuit pulsating when something can be pulled into it.
I just draw a simple rectangle around the ListView and update the transparency of the rectangle inside the timer event. When the transparency changes, the border is redrawn. At this moment I am duplicating the picture. I also allow redrawing every 15 ticks or so (the timer interval is 20 ms). After all this, the drawing process still flickers a bit. This is unacceptable, so I need to be guided by how I could avoid this.
I do not see the ability to draw control quite often. There should be a smooth transition from opaque to solid and vice versa. When I decrease the tick interval (to about 300-500 ms), the blinking stops, but the refresh rate is too low.
I am open to all ideas. Perhaps the way I'm approaching this is simply wrong, or perhaps one of you has already created a glow effect and knows what to do. Thanks for any help in advance.
Ed S. source
share