Board index » delphi » Flicker Flicker Flicker

Flicker Flicker Flicker

If I stick a Label over a TImage control, and change the label's font
colour at runtime, the whole label flickers. It looks as though the
image is getting repainted every time the label is updated.

This looks really naff. How can I prevent this flicker?

Thanks in advance...

Tony Ellis.

 

Re:Flicker Flicker Flicker


Quote
Tony Ellis <tel...@futurenet.co.uk> wrote:
>If I stick a Label over a TImage control, and change the label's font
>colour at runtime, the whole label flickers. It looks as though the
>image is getting repainted every time the label is updated.
>This looks really naff. How can I prevent this flicker?

How else do you propose to erase the old text before drawing the new
text, except by redrawing the image to erase the label, and then
drawing the label text over the image?  When you use transparent
controls, every control that intersects the invalidated region is
drawn, back to front.  It's the painter's algorithm.

To prevent the flicker (choose one):

a) don't put the label on top of the image
b) don't make the label transparent
c) draw the label and the image to an offscreen bitmap, then draw the
bitmap to the screen.  

-Danny

Other Threads