Java Image getDisabledImage(Image image)

Here you can find the source of getDisabledImage(Image image)

Description

Replies the disabled (grayed) version of the specified image.

License

GNU General Public License

Parameter

Parameter Description
image The image to disable

Return

The disabled (grayed) version of the specified image, brightened by 20%.

Declaration

public static final Image getDisabledImage(Image image) 

Method Source Code

//package com.java2s;
// License: GPL. For details, see LICENSE file.

import java.awt.Image;

import java.awt.Toolkit;

import java.awt.image.FilteredImageSource;

import javax.swing.GrayFilter;

public class Main {
    /**//from  w w  w.j a  v  a 2s  . com
     * Replies the disabled (grayed) version of the specified image.
     * @param image The image to disable
     * @return The disabled (grayed) version of the specified image, brightened by 20%.
     * @since 5484
     */
    public static final Image getDisabledImage(Image image) {
        return Toolkit.getDefaultToolkit()
                .createImage(new FilteredImageSource(image.getSource(), new GrayFilter(true, 20)));
    }
}

Related

  1. findImagefromClasspath(Class relToThisClass, String relImageName)
  2. generateImageVisualizationPanel(String path, int width, int height, int scaling)
  3. getChatLogoImage(int width, int height)
  4. getChatLogoImageBig(int width, int height)
  5. getColoredImage(Color color, int width, int height)
  6. getEingabeImage(int x, int y)
  7. getHeight(Image imagen)
  8. getImageByFilename(String filename)
  9. getImageImmediate(final Image image)