-4

我需要自动将图片加载到 TImage 中。我可以通过 pas 文件名找出 jpeg 的位置。如果文件名是“chapter14screen45”,那么我知道它是文件夹 14,然后是章节内的图像文件夹,那么 014.jpeg 应该被加载到 Image1 对象中。

4

1 回答 1

2

Example on how to load a Jpeg image into a TImage component :

procedure LoadJpgImage(DestImage : TImage ; Name : String);
begin
DestImage.Picture.LoadFromFile(Name);
end;

Where Name is the absolute path to the image for example : 'D:\jpeg\014.jpeg'.

If you are using an old Delphi version that does not include native TImage support for Jpeg then you need to find a third party implementation to be able to load a Jpeg Image into a TImage component.

于 2013-06-07T19:02:16.017 回答