Java ImageIcon prepareImage(ImageIcon icon, int x, int y)

Here you can find the source of prepareImage(ImageIcon icon, int x, int y)

Description

prepare Image

License

Open Source License

Declaration

private static ImageIcon prepareImage(ImageIcon icon, int x, int y) 

Method Source Code

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

import java.awt.Image;
import javax.swing.ImageIcon;

public class Main {
    private static ImageIcon prepareImage(ImageIcon icon, int x, int y) {
        Image img = icon.getImage();
        Image newImg = img.getScaledInstance(x, y, java.awt.Image.SCALE_SMOOTH);
        return new ImageIcon(newImg);
    }//from w w w. j av  a 2 s  . c o m
}

Related

  1. isValidImg(ImageIcon img)
  2. loadJavaInternal(ImageIcon r, Dimension d, boolean noStretch)
  3. makeDisabledImage(ImageIcon in)
  4. paintWithWatermarkHelper(JComponent component, ImageIcon watermark, Graphics g)
  5. parseImageIcon(Image image)
  6. saveImage(ImageIcon picture, String targetfile)
  7. setDefaultImageIcons(Window window)
  8. setImageIcon(ImageIcon icon, String description)
  9. setImageIcon(JLabel label, URL url)