07-23-2017 03:37 AM
Hello,
I'm using timer for drawing a moving body in each timer tick. For deleting the old draw, I'm using XOR mode and draw twice the moving body. It's work fine but it's has a lot of blinking. I need a solution which not including Delay().
Thank's
07-24-2017 01:41 PM
Hi Gabovich,
Would you be able to provide a little bit more information on how you are currently implementing this code and how using the Delay function is causing this blinking?
Thanks,
ShaneK
07-30-2017 08:45 PM
The blinking don't happen because of the Delay function. I don't use it in my code.
My goal is to draw moving point across the canvas. I draw it in every iteration of the timer. The problem is that the timer is too short (about 0.003 sec) and it's cause blinking. I use XOR mode in canvas pen for delete and draw every iteration. How can i fix it for the point will move in smooth way without blinking?
07-31-2017 01:02 AM
On one hand, 3 msec is a very fast rate for updating the screen. Considering that the usual standards for TV and movies run at 30 frames per second max with good visual results, you could modify your code to update the canvas only once every 10 times the timer control callback fires. This will also reduce system overhead and make your app more efficient.
On the other hand, you could probably have better canvas performances and avoid blinking using batch drawing: look for life.cws example to understand how to use this technique and how it results on screen.