Java ImageIcon Scale scaleImageIcon(ImageIcon icon, int w, int h)

Here you can find the source of scaleImageIcon(ImageIcon icon, int w, int h)

Description

scale Image Icon

License

Open Source License

Declaration

public static ImageIcon scaleImageIcon(ImageIcon icon, int w, int h) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;
import java.awt.*;

public class Main {
    public static ImageIcon scaleImageIcon(ImageIcon icon, int w, int h) {
        Image img = icon.getImage();
        return new ImageIcon(img.getScaledInstance(w, h, Image.SCALE_SMOOTH));
    }//from www. j  a v a2  s.c o m
}

Related

  1. scaleImage(ImageIcon i, int x, int y)
  2. scaleImage(ImageIcon icon)
  3. scaleImage(ImageIcon src, int width, int height)
  4. scaleImageIcon(ImageIcon icon, float scale, int hints)
  5. scaleImageIcon(ImageIcon icon, int newHeight, int newWidth)
  6. scaleImageIcon(String filePath, double maxHeight)
  7. scaleImageIconTo(ImageIcon source, int height, int width)