Board index » delphi » Problem loading a jpeg image

Problem loading a jpeg image


2006-07-08 08:30:27 AM
delphi111
I'm getting the message: ImageProject.exe raised exception class
EInvalidGraphic with message 'Unknown picture file extension (.jpg)'
And I am getting it from the following:
Image1.Picture.LoadFromFile('test.jpg'); where test.jpg exists and can
be opened by other software.
I'm using Delphi 7
Any ideas?
--
 
 

Re:Problem loading a jpeg image

rhys sage writes:
Quote
I'm getting the message: ImageProject.exe raised exception class
EInvalidGraphic with message 'Unknown picture file extension (.jpg)'

And I am getting it from the following:

Image1.Picture.LoadFromFile('test.jpg'); where test.jpg exists and can
be opened by other software.

I'm using Delphi 7


Any ideas?
Try adding "JPEG" to your Uses list.
David
 

Re:Problem loading a jpeg image

David J Taylor writes:
Quote
rhys sage writes:
>I'm getting the message: ImageProject.exe raised exception class
>EInvalidGraphic with message 'Unknown picture file extension (.jpg)'
>
>And I am getting it from the following:
>
>Image1.Picture.LoadFromFile('test.jpg'); where test.jpg exists and
>can be opened by other software.
>
>I'm using Delphi 7
>
>
>Any ideas?

Try adding "JPEG" to your Uses list.

David
Thanks. Got it working now :)
--