本文所述實(shí)例為Dlephi實(shí)現(xiàn)的窗口漸變文字效果,文字可以不停的變化,顏色由淺入深,由清淅變模糊,文字漸變的時(shí)間可在代碼中自己調(diào)整。主要實(shí)現(xiàn)代碼如下:
unit Unit1;interfaceuses 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;implementationvar 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.
新聞熱點(diǎn)
疑難解答
圖片精選