Example usage for java.awt.image ReplicateScaleFilter ReplicateScaleFilter

List of usage examples for java.awt.image ReplicateScaleFilter ReplicateScaleFilter

Introduction

In this page you can find the example usage for java.awt.image ReplicateScaleFilter ReplicateScaleFilter.

Prototype

public ReplicateScaleFilter(int width, int height) 

Source Link

Document

Constructs a ReplicateScaleFilter that scales the pixels from its source Image as specified by the width and height parameters.

Usage

From source file:com.krawler.esp.handlers.FileUploadHandler.java

private BufferedImage scaleImage(Image sourceImage, int width, int height, int typeRGB) {
    ImageFilter filter = new ReplicateScaleFilter(width, height);
    ImageProducer producer = new FilteredImageSource(sourceImage.getSource(), filter);
    Image resizedImage = Toolkit.getDefaultToolkit().createImage(producer);

    return this.toBufferedImage(resizedImage, typeRGB);
}

From source file:com.krawler.esp.handlers.genericFileUpload.java

private BufferedImage scaleImage(Image sourceImage, int width, int height) {
    ImageFilter filter = new ReplicateScaleFilter(width, height);
    ImageProducer producer = new FilteredImageSource(sourceImage.getSource(), filter);
    Image resizedImage = Toolkit.getDefaultToolkit().createImage(producer);

    return this.toBufferedImage(resizedImage);
}

From source file:com.krawler.esp.handlers.genericFileUpload.java

private BufferedImage scaleCompanyImage(Image sourceImage, int width, int height) {
    ImageFilter filter = new ReplicateScaleFilter(width, height);
    ImageProducer producer = new FilteredImageSource(sourceImage.getSource(), filter);
    Image resizedImage = Toolkit.getDefaultToolkit().createImage(producer);

    return this.toBufferedCompanyImage(resizedImage);
}

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

/**
 * Create a new scaled image using a filter.
 * @param sourceImage//from   w  ww  .  j a v a 2s. c  o 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);
}