wood burning stoves 2.0*
The moose likes Java in General and the fly likes resizing image.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "resizing image...." Watch "resizing image...." New topic
Author

resizing image....

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 753
Hi,

In my web application when user upload image, I want resize that image and than want to store it on the disk,

which api should i use to resize imege.

Following is my code which store image on disk. (Always JPG image)



Jigar Naik


Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

You can just use drawImage to draw the image on a different BufferedImage. With drawImage you can specify a height and width to draw the image at. See for example: Images - BufferedImage.

For more information on working with graphics in Java have a look at this: The Java Tutorial - 2D Graphics


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resizing image....
 
Similar Threads
Accepting File Uploads to Server
Storibg binary data in blog + mysql
jakarta fileupload - suggestions to improve my code
Storing image in blog fileld of mysql database
Displaying image which is outside my web application