要在image中显示一幅图片,按照图片的比例显示,请问应该怎么办,或者一个函数求图片的长和宽。

解决方案 »

  1.   

    用image.picture.width/height应该就可以,如:procedure TForm1.Button1Click(Sender: TObject);
    begin
      Caption := inttostr(image1.Picture.Width) + ' ' + inttostr(image1.Picture.Height);
      image1.Width := 2 * image1.Picture.Width;
      image1.Height := 2 * image1.Picture.Height;
      image1.Stretch := true;
    end;
      

  2.   

    属性
    1,portional
    Indicates whether the image should be changed, without distortion, so that it fits the bounds of the image control
    2,Stretch
    Indicates whether the image should be changed so that it exactly fits the bounds of the image control.
      

  3.   

    portional? 我使用的是5。0 啊