unit biltapp;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;type
TBilpApp = class(TForm)
BitBlt1: TButton;
Button1: TButton;
ticker: TImage;
procedure BitBlt1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
BilpApp: TBilpApp;
convertdatatobmp:Tbitmap;implementation{$R *.dfm}Function deal_withdata():integer;
begin
// BitBlt(BilpApp.Canvas.Handle,0,0,bmpwidth,i,
// image1.canvas.Handle,0,bmpheight - i,srccopy); //bmpheight - i bmpheight // BitBlt(Temp_bmp.Canvas.Handle,bmpwidth - i,0,i,bmpheight,
// newbmp.canvas.Handle,0,0,srccopy); // ticker// ticker.Canvas.CopyRect(Rect(0,0,bmpwidth,bmpheight),
// newbmp.Canvas,
// Rect(0,0,bmpwidth,bmpheight));
end;
procedure TBilpApp.BitBlt1Click(Sender: TObject);
var
newbmp:Tbitmap;
Temp_bmp:Tbitmap;
i,bmpheight,bmpwidth:integer;
Text:string;
begin
BitBlt1.Enabled := false;
newbmp:=tbitmap.create;
Temp_bmp:=tbitmap.create; newbmp.Canvas.Font.Size := 24;
newbmp.Canvas.Font.Color := clRed;
ticker.Canvas.Font.Size := 24;
ticker.Canvas.Font.Color := clRed;
Text := 'WELCOME Test Thanks!!!';
bmpwidth := newbmp.Canvas.TextWidth(Text);
bmpheight := newbmp.Canvas.TextHeight(Text);
newbmp.Width := bmpwidth;
newbmp.Height := bmpheight;
ticker.Height := bmpheight;
ticker.Width := bmpwidth;
{ ticker.Picture.Bitmap.Width := bmpwidth;
ticker.Picture.Bitmap.Height := bmpheight;
ticker.Picture.Bitmap.Canvas.Brush.Color := clbtnface; }
Temp_bmp.Width := bmpwidth;
Temp_bmp.Height := bmpheight; newbmp.Canvas.TextOut(0,0,Text);
ticker.Parent.DoubleBuffered := true;
DoubleBuffered := true; BitBlt(ticker.Canvas.Handle, 0, 0, bmpwidth, bmpheight,
ticker.Canvas.Handle, 0, 0, BLACKNESS);
for i:= 0 to bmpwidth do //bmpheight bmpwidth
begin
{ BitBlt(newbmp.Canvas.Handle, 0, 0, bmpwidth, bmpheight,
newbmp.Canvas.Handle, 0, 0, BLACKNESS); // }
BitBlt(BilpApp.Canvas.Handle,bmpwidth - i,0,i,bmpheight,
newbmp.canvas.Handle,0,0,srccopy); // ticker Temp_bmp // ticker.canvas.draw(0,0,Temp_bmp); //
if(i mod 2 = 0) then sleep(1);
application.ProcessMessages;
end;
BitBlt1.Enabled := true;
newbmp.free;
Temp_bmp.Free;
end;procedure TBilpApp.Button1Click(Sender: TObject);
begin
close;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;type
TBilpApp = class(TForm)
BitBlt1: TButton;
Button1: TButton;
ticker: TImage;
procedure BitBlt1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
BilpApp: TBilpApp;
convertdatatobmp:Tbitmap;implementation{$R *.dfm}Function deal_withdata():integer;
begin
// BitBlt(BilpApp.Canvas.Handle,0,0,bmpwidth,i,
// image1.canvas.Handle,0,bmpheight - i,srccopy); //bmpheight - i bmpheight // BitBlt(Temp_bmp.Canvas.Handle,bmpwidth - i,0,i,bmpheight,
// newbmp.canvas.Handle,0,0,srccopy); // ticker// ticker.Canvas.CopyRect(Rect(0,0,bmpwidth,bmpheight),
// newbmp.Canvas,
// Rect(0,0,bmpwidth,bmpheight));
end;
procedure TBilpApp.BitBlt1Click(Sender: TObject);
var
newbmp:Tbitmap;
Temp_bmp:Tbitmap;
i,bmpheight,bmpwidth:integer;
Text:string;
begin
BitBlt1.Enabled := false;
newbmp:=tbitmap.create;
Temp_bmp:=tbitmap.create; newbmp.Canvas.Font.Size := 24;
newbmp.Canvas.Font.Color := clRed;
ticker.Canvas.Font.Size := 24;
ticker.Canvas.Font.Color := clRed;
Text := 'WELCOME Test Thanks!!!';
bmpwidth := newbmp.Canvas.TextWidth(Text);
bmpheight := newbmp.Canvas.TextHeight(Text);
newbmp.Width := bmpwidth;
newbmp.Height := bmpheight;
ticker.Height := bmpheight;
ticker.Width := bmpwidth;
{ ticker.Picture.Bitmap.Width := bmpwidth;
ticker.Picture.Bitmap.Height := bmpheight;
ticker.Picture.Bitmap.Canvas.Brush.Color := clbtnface; }
Temp_bmp.Width := bmpwidth;
Temp_bmp.Height := bmpheight; newbmp.Canvas.TextOut(0,0,Text);
ticker.Parent.DoubleBuffered := true;
DoubleBuffered := true; BitBlt(ticker.Canvas.Handle, 0, 0, bmpwidth, bmpheight,
ticker.Canvas.Handle, 0, 0, BLACKNESS);
for i:= 0 to bmpwidth do //bmpheight bmpwidth
begin
{ BitBlt(newbmp.Canvas.Handle, 0, 0, bmpwidth, bmpheight,
newbmp.Canvas.Handle, 0, 0, BLACKNESS); // }
BitBlt(BilpApp.Canvas.Handle,bmpwidth - i,0,i,bmpheight,
newbmp.canvas.Handle,0,0,srccopy); // ticker Temp_bmp // ticker.canvas.draw(0,0,Temp_bmp); //
if(i mod 2 = 0) then sleep(1);
application.ProcessMessages;
end;
BitBlt1.Enabled := true;
newbmp.free;
Temp_bmp.Free;
end;procedure TBilpApp.Button1Click(Sender: TObject);
begin
close;
end;end.
要求:1.速度很快.
2.没有白条.
本人初用Delphi请个位多多指点.thanks!!