怎样实现在窗体中显示滚动字符?效果就象flash!
解决方案 »
- delphi编程中的启动SOCKET服务
- webbrowser模拟按钮提交?
- 在有SKIN的情况下,如何让cxButton实现闪动的效果呢?
- 向win.ini写数据不好使
- 急!!!,paradox表打不开,出错提示 Corrupt table/index header
- 数据转移:Paradox==>Sql Server.
- Auto-create forms与availble forms
- 疑惑:C/S系统中商业规则(存储过程)如何转移到三层系统中的AppServer??????
- 如何让不同的form使用共同的函数及过程?
- 暴走啦!!!!
- 是程序员或想成为程序员的请进?
- 如何在DLL文件中查看DLL文件的目录?
Procedure tform1.formcreate(sender:tobject);
begin// 设置字幕
label1.caption:='设计: 王三'+#13+#13
+‘编码: 李二’+#13+#13
+‘美工: 来哥’+#13+#13;
end;
在TIMER的事件中添加
Procedure tform1.ttimer1time(sender: tobject);
begin
label1.top:=label1.top-1;
if (label1.top<-label1.width-30) then
label1.top:=panel.height; //label的父类;
end;
可参照修改!!!
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;type
TForm1 = class(TForm)
Timer1: TTimer;
Image1: TImage;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
x,tt,w,h:integer;
Pic:Trect;
Map:Tbitmap;
implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
x:=image1.Height+20;
tt:=x+80;
// form1.Repaint;
image1.Canvas.brush.Color:=clgreen;
pic:=rect(0,0,image1.width,image1.height);
image1.Canvas.fillrect(pic);
map:=tbitmap.create;
map.loadfromfile('1.bmp');
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
x:=x-1;
tt:=tt-1;
if x<-200 then
begin
x:=image1.Height+20;
tt:=x+80;
end;
image1.Canvas.Font.Size:=18;
image1.Canvas.Font.Color:=$1200ffff;
image1.Canvas.TextOut(10,x,'OK 字 幕 移 动 演 示'); image1.Canvas.Font.Size:=20;
image1.Canvas.Font.Color:=$120000ff;
image1.Canvas.TextOut(20,x+50,'字 体 变 色 效 果 演示'); h:=image1.canvas.textheight('字体变色效果演 示');
w:=image1.Canvas.TextWidth('字体变色效果演示'); image1.Canvas.Pen.Color:=clGreen;
image1.canvas.moveto(20,h+x+50-2);
image1.canvas.LineTo(20+w,h+x+50-2);
pic.Topleft.x:=30;
pic.topleft.y:=tt;
pic.Bottomright.x:=pic.TopLeft.x+100;
pic.Bottomright.y:=pic.TopLeft.y+80;
image1.canvas.StretchDraw(pic,map);
image1.Canvas.Pen.color:=clgreen;
image1.Canvas.LineTo(pic.topleft.x+100,pic.topleft.y+80);
end;end.