Java ImageIcon Resize resize(ImageIcon src, int destWidth, int destHeight)

Here you can find the source of resize(ImageIcon src, int destWidth, int destHeight)

Description

Resizies an image using SCALE_SMOOTH (slow)

License

Open Source License

Parameter

Parameter Description
src a parameter
destWidth a parameter
destHeight a parameter

Declaration

public static ImageIcon resize(ImageIcon src, int destWidth,
        int destHeight) 

Method Source Code

//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));
    }
}

Related

  1. getResizedImageIcon(ImageIcon sourceImageIcon, int iRequiredWidth, int iRequiredHeight)
  2. resize(ImageIcon icon, int extent)
  3. resize(ImageIcon image, int width, int height)
  4. resize(ImageIcon src, Dimension size)
  5. resizeImageAspectRatio(int width, int height, ImageIcon orig_img)
  6. resizeImageIcon(ImageIcon icon, int width, int height)
  7. to50x50(ImageIcon imageIcon)