Can I retrieve Filename for TPicture directly?

后端 未结 3 1939
小蘑菇
小蘑菇 2020-12-12 05:56

I have a Delphi application which displays an image using a TImage.

The location of the image is stored in a database and retrieved on load and set directly using co

3条回答
  •  遥遥无期
    2020-12-12 06:18

    No, there isn't. You can store it yourself, though.

    var
      ImageFileName: string;
    
    
    begin
      ImageFileName := Query1.FieldByName('image').AsString;
      Image1.Picture.LoadFromFile(ImageFileName);
    end;
    

    Declare the ImageFileName variable at a place where it will be visible everywhere you need access to the file name.

提交回复
热议问题