Swing: resize Image but keep same size
问题 I want to be able to do something similar to resize canvas in gimp I want to generate a bunch of images to a certain width. I used int width = (int)(size * fraction); int height =(int)(size*icon.getIconHeight()/icon.getIconWidth()*fraction); miniature = new ImageIcon(i.getScaledInstance(width, height, Image.SCALE_SMOOTH)); this goes well while I'm doing fraction 1 but I have 3 images that have the same source but are different size (1, 2/3, 1/3) the problem is I have and image A I want to