• Post Reply Bookmark Topic Watch Topic
  • New Topic

resizing image....  RSS feed

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!