Board index » delphi » TImage component - Picture property - LoadFromFile method

TImage component - Picture property - LoadFromFile method

I am using a TImage component and can load the Picture
property at design time with a .JPG or .JPEG file, however,
during run time I use the LoadFromFile method and it
will not accept the .JPG or .JPEG file.

I get the following error:
Unknown picture file extension (.JPEG)

Why is this happening?

It works fine with .BMP files.

Thanks
Brad

 

Re:TImage component - Picture property - LoadFromFile method


Quote
Brad Smith wrote:
> I am using a TImage component and can load the Picture property at
> design time with a .JPG or .JPEG file, however, during run time I use
> the LoadFromFile method and it will not accept the .JPG or .JPEG file.

Same thing happened to me.  You need to include 'jpeg' in your uses
clause.

uses jpeg;

Good luck.

Other Threads