Resize/Crop jpeg image

I have a TImage that uses LoadFromFile() to load a jpeg image.
I have a method for checking the size of the image (e.g. max 640x480) and want to change the the image size to the max size and then use SaveToFile() to save that image again.
The reason for this is to make the filesize smaller when sending via email or internet.

Any help would be grealy appreciated!

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.

George TokasCommented:
Check out TImage::Stretch property at online help..
I think is what you need...

Kent OlsenData Warehouse Architect / DBACommented:

Assuming that you're using a TJPEGImage, you can save a bunch more space by reducing the value in the CompressionQuality property.

First, if you want to reduce the file size , you should reduce image size , not increase it.

to change a jpeg image size , you can create a bitmap object , and set it's height and width to your desired size , and then use draw() method to draw the jpeg image in bitmap object, then again draw it to a jpeg image and save it to a file.
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Balder1978Author Commented:
I'm using Borland C++ 4 and I don't have the TJPEGImage compnent available, I'm using TImage.

Yes, reduce the size. If the size is larger than 640x480 then it should reduce the size to 640x480.

I'll check out the drawing thingy, thanks.
sorry, you should use stretchdraw not draw.

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
Balder1978Author Commented:
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
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.