Java ImageIcon Scale scaleImageIconTo(ImageIcon source, int height, int width)

Here you can find the source of scaleImageIconTo(ImageIcon source, int height, int width)

Description

scale Image Icon To

License

Apache License

Declaration

public static ImageIcon scaleImageIconTo(ImageIcon source, int height, int width) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Image;

import javax.swing.ImageIcon;

public class Main {
    public static ImageIcon scaleImageIconTo(ImageIcon source, int height, int width) {
        return new ImageIcon(source.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH));
    }//from www . j  a v  a  2 s .c  o m
}

Related

  1. scaleImage(ImageIcon src, int width, int height)
  2. scaleImageIcon(ImageIcon icon, float scale, int hints)
  3. scaleImageIcon(ImageIcon icon, int newHeight, int newWidth)
  4. scaleImageIcon(ImageIcon icon, int w, int h)
  5. scaleImageIcon(String filePath, double maxHeight)