I do not know why this method does not work to resize an image. No errors occur (I have an exception if so):
private static void resizeImage(int width, int height) {
try {
BufferedImage rawImg = ImageIO.read(new File("%imgg%.png"));
int gamlaWidth = rawImg.getWidth();
int gamlaHeight = rawImg.getHeight();
BufferedImage dimg = new BufferedImage(width, height, rawImg.getType());
Graphics2D g = rawImg.createGraphics();
g.drawImage(rawImg, 0, 0, 114, 114, null);
g.dispose();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ett fel uppstod:\n" + e, "Felmeddelande", 0);
}
}
Why doesn't this code change anything? I want the size to be 114x114.