LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Blinking DrawPoint

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

0 Kudos
Message 1 of 4
(2,627 Views)

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

0 Kudos
Message 2 of 4
(2,533 Views)

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?

0 Kudos
Message 3 of 4
(2,488 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 4
(2,482 Views)