im having a problem with resizing pictures in java!
i get the pictures from an xml document but most of them are in landscape mode!
i need to have them resized/converted into portrait mode so they fit into my GUI layout.
is there a method for doing this??
In order to convert a picture from landscape mode to portrait mode, without rotating, you first have to crop the picture. Then, you may have to reduce the size of the picture.
Let’s say your landscape picture is 500 x 300 pixels, and you want your portrait picture to be 150 X 250 pixels.
You could crop the landscape picture to 180 X 300 pixels by cropping the center. Then you can reduce the cropped picture down to 150 x 250 pixels.
Here’s some Java code for cropping an image:
image is a java.awt.Image, and toolkit is the default java.awt.Toolkit.