查看: 120|回复: 0

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

[复制链接]

2

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2009-8-18
发表于 2014-7-24 11:29:08 | 显示全部楼层 |阅读模式

本文所述实例为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.

您可能感兴趣的文章:
  • 背景,文字渐变(无闪屏)
  • photoshop去除渐变色上的文字的简单方法
  • jQuery实现的立体文字渐变效果
  • js实现类似光照的炫彩文字渐变视觉冲击效果
  • jQuery实现的文字hover颜色渐变效果实例
  • 神奇!js+CSS+DIV实现文字颜色渐变效果
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

圆梦公社,专注于为全球华人提供纯粹技术交流的地方,请勿发布任何政治及违法的言论。如有相关侵权、举报、投诉及建议等,请发 E-mail:dzh188@hotmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部