Java Draw Image drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)

Here you can find the source of drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)

Description

draw Image

License

Open Source License

Declaration

private static void drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
            int sx2, int sy2) 

Method Source Code


//package com.java2s;
/*/*from  w ww .j  a  v  a  2  s . c  o  m*/
 * %W% %E%
 *
 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.awt.Graphics;
import java.awt.Image;

public class Main {
    private static void drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1,
            int sx2, int sy2) {
        // PENDING: is this necessary, will G2D do it for me?
        if (dx2 - dx1 <= 0 || dy2 - dy1 <= 0 || sx2 - sx1 <= 0 || sy2 - sy1 <= 0) {
            // Bogus location, nothing to paint
            return;
        }
        g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
    }
}

Related

  1. drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src)
  2. drawImage(Graphics graphics, Component comp, Image image)
  3. drawImage(Graphics2D g, BufferedImage image, int x, int y)
  4. drawImage(Graphics2D g2d, BufferedImage image, Rectangle dispArea)
  5. drawImage(Image image, Dimension windowSize, Graphics graphics)
  6. drawImage(Image img, double x, double y, Graphics2D graphics)
  7. drawImageClip(Graphics g, BufferedImage image, ImageObserver observer)
  8. drawImageInOval(Graphics2D gr, Image img, Rectangle r, boolean noShrink)
  9. drawImageInPolygon(Graphics g2d, BufferedImage img, Polygon poly, double xfactor, double yfactor)