在Delphi中如何像VF那样将一张小图片平铺在Form上?谢谢!

解决方案 »

  1.   

    在OnPaint事件里:
    var
      x,y:integer;
    begin
        y:=0;
        while y <Height do
        begin X:=0;
          while X<Width do
          begin
            Canvas.Draw(X,Y,Image1.Picture.Bitmap);
           //Image1.Picture.Bitmap要平铺的图片
            X:=X+Image1.Picture.Bitmap.Width;
          end;
          Y:=Y+Image1.Picture.Bitmap.Height;
        end;
    end;
      

  2.   

    procedure TForm1.Form1Paint(Sender:TObject);
    begin
      Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon});
    //这是拉伸
    end;
      

  3.   

    procedure TForm1.Form1Paint(Sender:TObject);
    begin
      Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon});
     end;
      

  4.   

    Canvas.StretchDraw(Rect(0,0,Width,Height),Picture{eg:TIcon});
      

  5.   

    对的对的!飞飞猫我就是这个问题,像网页一样平铺!我用了一个image.对了这个问题两天前我也问过,可没有人给我一个好的答案!能帮我吗?
      

  6.   

    to delphichuxue(delphi) ( ) 我的方法就可以啊!