Java Draw Image drawImage(Graphics2D g, BufferedImage image, int x, int y)

Here you can find the source of drawImage(Graphics2D g, BufferedImage image, int x, int y)

Description

Malt ein BufferedImage auf ein Graphics2D-Objekt.

License

Open Source License

Parameter

Parameter Description
g Graphics2D
image BufferedImage
x X-Koordinate
y Y-Koordinate

Declaration

public static void drawImage(Graphics2D g, BufferedImage image, int x, int y) 

Method Source Code


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

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

public class Main {
    /**/*from   w  w  w .jav a 2 s. c o  m*/
     * Malt ein BufferedImage auf ein Graphics2D-Objekt.
     *
     * @param g
     *            Graphics2D
     * @param image
     *            BufferedImage
     * @param x
     *            X-Koordinate
     * @param y
     *            Y-Koordinate
     */
    public static void drawImage(Graphics2D g, BufferedImage image, int x, int y) {
        g.drawImage(image, x, y, null);
    }

    /**
     * Malt ein BufferedImage auf ein Graphics2D-Objekt.
     *
     * @param g
     *            Graphics2D
     * @param image
     *            BufferedImage
     * @param x
     *            X-Koordinate
     * @param y
     *            Y-Koordinate
     * @param width
     *            Breite
     * @param height
     *            Hoehe
     */
    public static void drawImage(Graphics2D g, BufferedImage image, int x, int y, int width, int height) {
        g.drawImage(image, x, y, width, height, null);
    }
}

Related

  1. drawImage(BufferedImage srcImg, BufferedImage img2Draw, int w, int h)
  2. drawImage(BufferedImage target, Point targetPoint, BufferedImage source)
  3. drawImage(final Graphics2D graphics, final Image image, final Rectangle rectangle)
  4. drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src)
  5. drawImage(Graphics graphics, Component comp, Image image)
  6. drawImage(Graphics2D g2d, BufferedImage image, Rectangle dispArea)
  7. drawImage(Image image, Dimension windowSize, Graphics graphics)
  8. drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
  9. drawImage(Image img, double x, double y, Graphics2D graphics)