Java Draw Image drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height)

Here you can find the source of drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height)

Description

draw Image

License

Apache License

Declaration

private static void drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height) 

Method Source Code

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

import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;

public class Main {
    private static void drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height) {
        Graphics2D g = scaledImage.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
        g.drawImage(originalImage, 0, 0, width, height, 0, 0, originalImage.getWidth(), originalImage.getHeight(),
                null);/*from   w w  w.ja  v a2s .c o  m*/
        g.dispose();
    }
}

Related

  1. drawBytes(BufferedImage image, byte[] buf)
  2. drawCenterCrop(Graphics2D g, BufferedImage source, Rectangle dstRect)
  3. drawCenteredImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight, boolean shrink)
  4. DrawCross(BufferedImage bi, Point pt)
  5. drawImage(BufferedImage bi, RenderedImage im)
  6. drawImage(BufferedImage srcImg, BufferedImage img2Draw, int w, int h)
  7. drawImage(BufferedImage target, Point targetPoint, BufferedImage source)
  8. drawImage(final Graphics2D graphics, final Image image, final Rectangle rectangle)
  9. drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src)