Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

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.

Thanks
Avatar of Lunda_Construction
Lunda_Construction
Flag of United States of America image

Open the .jpg file in Microsoft Photo Editor and right click on it and go to properties.  It will tell you the size.
Avatar of hidrau

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of SteveBay
SteveBay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hidrau

ASKER

thanks
Perhaps this is an even more simple approach
procedure TForm3.FormShow(Sender: TObject);
begin
     // After loading the image. 
     Image1.Align :=alNone;
     ClientHeight := Image1.Height;
     ClientWidth := Image1.Width;
     Image1.Align :=alClient;
end;

Open in new window