欢迎来到工商注册核名查询系统!

Delphi

当前位置:主页 > 软件编程 > Delphi >

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

来源:本站原创|时间:2022-11-25|栏目: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

您可能感兴趣的文章

阅读排行

本栏相关

随机阅读

网页制作CMS教程网络编程软件编程脚本语言数据库服务器

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

Copyright © 2002-2020 工商注册核名查询系统 版权所有