Skip to main content
Robin Zhou
Associate II
May 19, 2019 3:00 PM UTC
Solved

Why using CanvasWidget class to draw lines encounter flicking problem?

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.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
May 20, 2019 8:18 AM UTC

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 8:18 AM UTC

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 5:29 AM UTC

Thanks for the reply. My problem is solved.

BMara.1
Associate
Dec 12, 2019 7:22 PM UTC

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