The class contain an easy to use method that operates on an image stream and resizes it to the given dimensions.
Example:
package sample;
import java.io.IOException;
import resizeimage.ResizeImage;
/**
*
* @author Marcelo Silva
*/
public class ResizeImageSample {
public static void main(String... args) {
//The original image is 1024X768 in JPEG format.
new ResizeImageSample().test();
}
public void test() {
try {
// Resizing the image into a 600X400 PNG image
ResizeImage.resizeImage( this.getClass().getResourceAsStream("test.jpg"), 600, 400, "png","testResizeImage","C:\\test\\");
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
Questions & Comments