Java Draw Image drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src)

Here you can find the source of drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src)

Description

draw Image

License

Open Source License

Declaration

public static void drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src) 

Method Source Code

//package com.java2s;
/*//from  w  ww .  ja  v a2s . com
 * Copyright (C) 2013 dirbaio
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.awt.Graphics;
import java.awt.Rectangle;

import java.awt.image.BufferedImage;

public class Main {
    public static void drawImage(Graphics g, BufferedImage im, Rectangle dst, Rectangle src) {
        g.drawImage(im, dst.x, dst.y, dst.x + dst.width, dst.y + dst.height, src.x, src.y, src.x + src.width,
                src.y + src.height, null);
    }

    public static void drawImage(Graphics g, BufferedImage im, int dstx, int dsty, Rectangle src) {
        g.drawImage(im, dstx, dsty, dstx + src.width, dsty + src.height, src.x, src.y, src.x + src.width,
                src.y + src.height, null);
    }
}

Related

  1. drawImage(BufferedImage bi, RenderedImage im)
  2. drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height)
  3. drawImage(BufferedImage srcImg, BufferedImage img2Draw, int w, int h)
  4. drawImage(BufferedImage target, Point targetPoint, BufferedImage source)
  5. drawImage(final Graphics2D graphics, final Image image, final Rectangle rectangle)
  6. drawImage(Graphics graphics, Component comp, Image image)
  7. drawImage(Graphics2D g, BufferedImage image, int x, int y)
  8. drawImage(Graphics2D g2d, BufferedImage image, Rectangle dispArea)
  9. drawImage(Image image, Dimension windowSize, Graphics graphics)