// image1.canvas.stretchdraw(pic,map);

解决方案 »

  1.   


    我是想要你把整个Unit贴出来:)
      

  2.   

    Apollo47(阿波罗):试过,没用!
      

  3.   

    unit Unit1;interfaceuses
      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 ×&Ouml; &Auml;&raquo; &Ograve;&AElig; &para;&macr; &Ntilde;&Yacute; &Ecirc;&frac34;');image1.Canvas.font.size:=12;image1.Canvas.font.color:=$120000ff;image1.Canvas.TextOut(20,x+50,' ×&Ouml; &Igrave;&aring; ±&auml; &Eacute;&laquo; &ETH;§ &sup1;&ucirc; &Ntilde;&Yacute; &Ecirc;&frac34;');l:=image1.Canvas.textwidth(' ×&Ouml; &Igrave;&aring; ±&auml; &Eacute;&laquo; &ETH;§ &sup1;&ucirc; &Ntilde;&Yacute; &Ecirc;&frac34;');h:=image1.Canvas.textheight(' ×&Ouml; &Igrave;&aring; ±&auml; &Eacute;&laquo; &ETH;§ &sup1;&ucirc; &Ntilde;&Yacute; &Ecirc;&frac34;');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.
      

  4.   

    拉两个控件在窗口中就可以运行(winnt,win2000),在98下就改一下这一句:map.loadfromfile('d:\winnt\Zapotec.bmp');//怎样该我用我多嘴了吧!
      

  5.   


    怪了!我这边没什么闪烁啊!我将Form1.OnCreate取消了都行!Interval设的是10。
      

  6.   


    怪了!我这边没什么闪烁啊!我将Form1.OnCreate取消了都行!Interval设的是10。
      

  7.   

    enlightenment(阿明--平均睡眠时间<6h/d的超人) :98还是nt还是2000?
    我这里真的闪得利害,其他哥们呢?试了吗?
      

  8.   

    oncreate去了根本无法看啦,5~~~
      

  9.   


    那,我的程序神啦!:)Win98+Delphi5
      

  10.   

    真倒霉呀!大家都不闪,我闪!
    philips普通显示器,其他工作一切正常!
      

  11.   

    用Script(精灵原理),游戏中常用的方法。
    看看编游戏的书吧!
    我的EMAIL为,[email protected],可以与我联系
      

  12.   

    设置 Form1.DoubleBuffered:= True;
      

  13.   

    换成TextOut(Image1.Canvas.Handle, x, y, 'text', Length('text'));
    试试,看得不得。
      

  14.   

    sleeepboy(阿闲) :高定了!谢谢!谢谢各位!
      

  15.   

    DoubleBuffered这个属性怎么这么重要呢?
      

  16.   

    看看关于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.呵呵 分啊……