我需要将原始缓冲图像调整大小为宽度100 px,并保留宽度/高度比。以下是我使用的代码。有人能帮我吗?
提前致谢。
int width = 100;
int height = 100;
BufferedImage resizedImage = new BufferedImage(width, height, type);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, width, height, null);
g.dispose();