同上

解决方案 »

  1.   

    两个属性就搞定了。在Form上放Image控件,设Image的align属性为:alClient,stretch属性设为:true
      

  2.   

    Form1.AutoSize:=True;
    with Image1 do 
    begin
      Strech:=False;
      Align:=alClient;
    end;
      

  3.   

    你懂photoshop吗,最好的办法是将图片的大小设置到跟你的窗口的大小一样,这回没有问题了吧!要记得设Strech:=False;
      

  4.   

    自己计算窗口大小和图片大小,用CopyRect往上贴不就行了
      

  5.   

    我只完成了一部分代码,剩下的你自己加吧
    procedure TForm1.FormResize(Sender: TObject);
    var
      pic: TBitmap;
      rect1, rect2: TRect;
      x, y: integer;
      xm, ym: integer;
      i, j: integer;
    begin
      pic := TBitmap.Create;
      pic.LoadFromFile('CIBAS.bmp');
      rect1 := rect(0, 0, 0, 0);
      rect2 := rect(0, 0, 0, 0);
      x := -1; y := -1;
      xm := 0; ym := 0;  if pic.Width < Width then
      begin
        rect1.Right := pic.Width;
        x := width div pic.Width;
        xm := width mod pic.Width;
      end else
        rect1.Right := Width;  if pic.Height< Height then
      begin
        y := Height div pic.Height;
        ym := Height mod pic.Height;
      end else
        rect1.Bottom := Height;  if (x > 0) and (y > 0) then
      begin
        //for i := 0 to x-1 do
      end;  if (x > 0) and (y < 0) then
      begin
        rect2.Top := 0;
        rect2.Bottom := Height;
        for i := 0 to x-1 do
          with Image1.Canvas do
          begin
            rect2.Left := i* pic.Width;
            rect2.Right := (i+1)* pic.Width;
            CopyRect(rect2, pic.Canvas, rect1);
            CopyMode := cmSrcCopy;
          end;
        if xm > 0 then
          with Image1.Canvas do
          begin
            rect2.Left := x* pic.Width;
            rect2.Right := x* pic.Width+xm;
            rect1.Right := xm;
            CopyRect(rect2, pic.Canvas, rect1);
            CopyMode := cmSrcCopy;
          end;
      end;  if (x < 0) and (y > 0) then
      begin
      end;  if (x < 0) and (y < 0) then
        with Image1.Canvas do
        begin
          CopyRect(ClientRect, pic.Canvas, rect1);
          CopyMode := cmSrcCopy;
        end;
      pic.Free;
    end;
      

  6.   

    不好意思,走弯路了
    procedure TForm1.Button1Click(Sender: TObject);
    var
      pic: TBitmap;
    begin
      pic := TBitmap.Create;
      try
        pic.LoadFromFile('CIBAS.bmp');
        Canvas.Brush.Bitmap := pic;
        Canvas.FillRect(ClientRect)
      finally
        Canvas.Brush.Bitmap := nil;
        pic.Free;
      end;
    end;