加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Delphi实现窗口文字淡入淡出渐变效果的方法

发布时间:2020-12-15 04:24:24 所属栏目:大数据 来源:网络整理
导读:本文所述实例为Dlephi实现的窗口渐变文字效果,文字可以不停的变化,颜色由浅入深,由清淅变模糊,文字渐变的时间可在代码中自己调整。主要实现代码如下: unit Unit1;interfaceuses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Di

本文所述实例为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,b);
  //改变文字颜色
  r:=r+1;
  g:=g+1;
  b:=b+1;
 end
 else
  begin
  r:=0;
  g:=0;
  b:=0;
  end;
end;
end.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读