在一个事件中:
image1.width:=300;
image1.height:=200;
image1.canvas.line(300,200);另个事件中
image1.width:=600;
image1.height:=400;
image1.canvas.line(600,400);好了,就算你用尽吃奶的力气,也永远无法使它变的更大!!!\
到底为什么?

解决方案 »

  1.   

    加一句:
    image1.stretch:=true;image1.autosize:=false;
      

  2.   

    不知道你代码中image1.canvas.line(300,200);这一句是想实现什么功能的?
      

  3.   

    function TForm1.ScalePercentBmp(Bitmap: TBitmap; iPercent: Integer): Boolean;
    var
      TmpBmp: TBitmap;
      ARect: TRect;
      h, w: Integer;
    begin
      Result := False;
      try
        TmpBmp := TBitmap.Create;
        try
          h := Floor(Bitmap.Height * (iPercent / 100));  //uses Math;
          w := Floor(Bitmap.Width * (iPercent / 100));
          ARect := Rect(0, 0, w, h);
          TmpBmp.Width := w;
          TmpBmp.Height := h;
          TmpBmp.Canvas.StretchDraw(ARect, Bitmap);
          Bitmap.Assign(TmpBmp);
        finally
          TmpBmp.Free;
        end;
        Result := True;
      except
        Result := False;
      end;
    end;
      

  4.   

    只有先用Image1->Picture=NULL把图片卸了,然后再改变Image的大小,再把图片加进去,就可以了