换成TextOut(Image1.Canvas.Handle, x, y, 'text', Length('text')); 试试,看得不得。
sleeepboy(阿闲) :高定了!谢谢!谢谢各位!
DoubleBuffered这个属性怎么这么重要呢?
看看关于DoubleBuffered的帮助吧 Determines whether the control image is rendered directly to the window or painted to an in-memory bitmap first. property DoubleBuffered: Boolean;DescriptionWhen DoubleBuffered is False, the windowed control paints itself directly to the window. When DoubleBuffered is True, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive.When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.呵呵 分啊……
我是想要你把整个Unit贴出来:)
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
x,tt,l,h:integer; pic:Trect; map:Tbitmap;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
timer1.enabled:=true;timer1.Interval:=10;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);pic:=Rect(-1,-1,1,1);map:=Tbitmap.create;map.loadfromfile('d:\winnt\Zapotec.bmp');image1.canvas.stretchdraw(pic,map);
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
x:=x-1;tt:=tt-1;if x<-160 thenx:=image1.height+20;tt:=x+80;image1.Canvas.font.size:=18;image1.Canvas.font.color:=$1200ffff;image1.Canvas.TextOut(10,x,'OK ×Ö Ä» ÒÆ ¶¯ ÑÝ Ê¾');image1.Canvas.font.size:=12;image1.Canvas.font.color:=$120000ff;image1.Canvas.TextOut(20,x+50,' ×Ö Ìå ±ä É« Ч ¹û ÑÝ Ê¾');l:=image1.Canvas.textwidth(' ×Ö Ìå ±ä É« Ч ¹û ÑÝ Ê¾');h:=image1.Canvas.textheight(' ×Ö Ìå ±ä É« Ч ¹û ÑÝ Ê¾');image1.Canvas.pen.color:=clGreen;image1.Canvas.moveto(20,h+x+50-2);image1.Canvas.lineto(20+l,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.moveto(0,pic.topleft.y+80);image1.Canvas.lineto(pic.topleft.x+100,pic.topleft.y+80);
end;end.
怪了!我这边没什么闪烁啊!我将Form1.OnCreate取消了都行!Interval设的是10。
怪了!我这边没什么闪烁啊!我将Form1.OnCreate取消了都行!Interval设的是10。
我这里真的闪得利害,其他哥们呢?试了吗?
那,我的程序神啦!:)Win98+Delphi5
philips普通显示器,其他工作一切正常!
看看编游戏的书吧!
我的EMAIL为,[email protected],可以与我联系
试试,看得不得。
Determines whether the control image is rendered directly to the window or painted to an in-memory bitmap first. property DoubleBuffered: Boolean;DescriptionWhen DoubleBuffered is False, the windowed control paints itself directly to the window. When DoubleBuffered is True, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive.When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.呵呵 分啊……