Skip to main content
Robin Zhou
Associate II
May 19, 2019
Solved

Why using CanvasWidget class to draw lines encounter flicking problem?

  • May 19, 2019
  • 3 replies
  • 2027 views

0690X000008w53bQAA.jpg

Hi, I encounter a problem to continuously display a physiological waveform through the subclass of CanvasWidget class developed. The dots on the line were added to an FIFO buffer in the subclass within the handleTickEvent() function of the view, then invalidate the corresponding rectangular area with InvalidateRec() function, the drawCanvasWidget() virtual function was reimplementation in the subclass to draw the lines with canvas render class.

But as show in the picture, the lines near to the right border of the widget would flicking continuously. Is there a good way to solve the flicking problem ? Suggestion is needed here.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

This is usually because you're drawing outside the area you're invalidating, so the flickering is due to a pixel being present in one framebuffer but not the other. Probably your invalidated area is not wide enough.

/Martin

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 20, 2019

This is usually because you're drawing outside the area you're invalidating, so the flickering is due to a pixel being present in one framebuffer but not the other. Probably your invalidated area is not wide enough.

/Martin

Robin Zhou
Associate II
May 24, 2019

Thanks for the reply. My problem is solved.

BMara.1
Associate
December 12, 2019

Would you have any example code that youd be willing to share? I am currently having the same issue.