Re:TLabel Fade in/Fade out effect
Quote
??? wrote in message <35c7009...@ruby.hknet.com>...
>Hello,
>I want to make a fade in / fade out effect when display a message on the
>form using TLabel.
>My idea is, use a Timer and decrease the color of the label until it match
>the color of my Form.
>However, problems occured. When the font size is small, it's OK. But after
I
>change the font size of the label to a larger one (eg. 24), the caption of
>the label blinks when performing fade in/fade out effect. Is there any
>method to solve that ( I think it is the problem of refreshing)?
Most likely you are seeing some screen flicker, yes.
What you could do is wait for the vertical blanking of the videocard.
I am sure windows has a routine for this, and if anyone knows it, please
inform us both, but meanwhile, you can have my assembly routine for the same
thing:
Just paste this into the routine updating the graphics BEFORE updating it.
/If the fading takes long, it would also be wise to make a call to the
application.processmessages within there.
ASM
push dx
push ax
@VBLANK:
mov dx,03dah
in al,dx
and al,08h
jz @vblank
pop ax
pop dx
End;
If you fade by using a for-loop, remember that the assembly part must be
within the loop, as what it does, is just to wait for the scanline to reach
the top of your screen.
I think this will work on all resolutions and modes, but I havent used it
much since the good old 320*200*8 bit days.
Good luck!
Christian Lassem