How can I get the width and the heigh of my jpg file?

I have a jpg that I will load into my form, I would like to get the information of width and heigh, so that I can adjust my form according to its dimension.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Open the .jpg file in Microsoft Photo Editor and right click on it and go to properties.  It will tell you the size.
hidrauAuthor Commented:
No, I need to get the size through my program so that I can resize my window to the size of the my jpg.

Let me explain better

I have a jpg that I will be loaded into my form, in the component image.

But this jpg can diversify its size, that will only depend the way I record my jpg.
My form is 600 * 800 but if my jpg file is 500 * 500, then I need resize my form.

Did you get it?
If I understand you need to lock the .jpg file into a size and position on the form.  

What software are you using to create the form.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Here is a simple approach:
Uses Jpeg;
procedure TForm2.MeasureJPG(FileName: String; var H, W: integer);
var Image : TImage;
     Image := TImage.Create(Self);
     Image.AutoSize := True;
     h := Image.Width;
     w := Image.Height;

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hidrauAuthor Commented:
Perhaps this is an even more simple approach
procedure TForm3.FormShow(Sender: TObject);
     // After loading the image. 
     Image1.Align :=alNone;
     ClientHeight := Image1.Height;
     ClientWidth := Image1.Width;
     Image1.Align :=alClient;

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.