Use Java to resize an image?

Started by Saxon, November 17, 2016, 07:04:54 PM

Previous topic - Next topic

Marcel

Hi everyone, I have a little question that gets in my head ... I would like to know use java to resize an image? Please answer the question.

Iestyn

Graphics2D is providing the image re-size feature as follows :

BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, type);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_HEIGHT, null);
g.dispose();