Example usage for java.awt Image getSource

List of usage examples for java.awt Image getSource

Introduction

In this page you can find the example usage for java.awt Image getSource.

Prototype

public abstract ImageProducer getSource();

Source Link

Document

Gets the object that produces the pixels for the image.

Usage

From source file:org.tolven.security.bean.DocProtectionBean.java

/**
 * Create a new scaled image using a filter.
 * @param sourceImage/*from  w ww .  ja  v a2s  .co m*/
 * @param width The width of the resulting picture
 * @param height The height of the resulting picture
 * @return The Image
 */
static public Image scaleImage(Image sourceImage, int width, int height) {
    ImageFilter filter = new ReplicateScaleFilter(width, height);
    ImageProducer producer = new FilteredImageSource(sourceImage.getSource(), filter);
    return Toolkit.getDefaultToolkit().createImage(producer);
}