Here you can find the source of resize(ImageIcon src, int destWidth, int destHeight)
Parameter | Description |
---|---|
src | a parameter |
destWidth | a parameter |
destHeight | a parameter |
public static ImageIcon resize(ImageIcon src, int destWidth, int destHeight)
//package com.java2s; import java.awt.Image; import javax.swing.ImageIcon; public class Main { /**//w w w .j av a 2 s .co m * Resizies an image using SCALE_SMOOTH (slow) * * @param src * @param destWidth * @param destHeight * @return */ public static ImageIcon resize(ImageIcon src, int destWidth, int destHeight) { return new ImageIcon(src.getImage().getScaledInstance(destWidth, destHeight, Image.SCALE_SMOOTH)); } }