This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to resize image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to resize image" Watch "How to resize image" New topic
Author

How to resize image

rose deng
Ranch Hand

Joined: Dec 29, 2000
Posts: 78
Hi.
I want to resize image, say,the original size of the image is 800*600, i want to reduce it to 80% of original size.
How to.
Thanks for your kind help in advance.
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
Here is a link to the docs for the Image method getScaledInstance:
http://java.sun.com/j2se/1.3/docs/api/java/awt/Image.html#getScaledInstance(int,int,in t)
It takes a new height and width for parameters, not percentage, but you should be able to calculate those yourself.
[This message has been edited by Angela Ann (edited March 29, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to resize image
 
Similar Threads
how to get Image from Canvas
help needed to reshape an image
several animation frames in one file, transparency issues
Image in JLabel
Retrive Exif data from jpeg Image