Delphi实现窗口文字淡入淡出渐变效果的方法
更新时间:2014年07月24日 11:29:08 投稿:shichen2014
这篇文章主要介绍了Delphi实现窗口文字淡入淡出渐变效果,需要的朋友可以参考下
本文所述实例为Dlephi实现的窗口渐变文字效果,文字可以不停的变化,颜色由浅入深,由清淅变模糊,文字渐变的时间可在代码中自己调整。主要实现代码如下:
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Timer1: TTimer; Label1: TLabel; procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation var r,g,b:integer; {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); begin if (r<=255) and (g<=255) and (b<=255) then begin Label1.Font.Color:=RGB(r,g,b); //改变文字颜色 r:=r+1; g:=g+1; b:=b+1; end else begin r:=0; g:=0; b:=0; end; end; end.
相关文章
为什么继续选择DELPHI(即将逝去的Delphi前景在何方)
已经钻DELPHI很深了,当然现在DELPHI是过了最辉煌的时代。但为什么要继续下去,而不转向其它的?这是不是死脑筋2018-02-02delphi中exit,abort,break,continue的区别介绍
本文详细介绍下delphi中表示跳出的有break,continue, exit,abort, halt, runerror的区别,感兴趣的朋友可以参考下哈,希望对你学习跳出有所帮助2013-04-04
最新评论