[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Resize/Crop jpeg image

Posted on 2004-11-03
6
Medium Priority
?
533 Views
Last Modified: 2013-11-17
Hi!
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!

Thanks!
0
Comment
Question by:Balder1978
6 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 12482403
Check out TImage::Stretch property at online help..
I think is what you need...

gtokas.
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 12505230

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

Kent
0
 
LVL 4

Expert Comment

by:mbprogrammer
ID: 12555714
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.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Author Comment

by:Balder1978
ID: 12555843
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.
0
 
LVL 4

Accepted Solution

by:
mbprogrammer earned 1000 total points
ID: 12559130
sorry, you should use stretchdraw not draw.
0
 
LVL 2

Author Comment

by:Balder1978
ID: 12612533
Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question