Java BufferedImage Operation duplicate(BufferedImage image)

Here you can find the source of duplicate(BufferedImage image)

Description

Create a copy of this BufferedImage.

License

Open Source License

Parameter

Parameter Description
image the image to create a copy of.

Return

a duplicate.

Declaration

public static BufferedImage duplicate(BufferedImage image) 

Method Source Code


//package com.java2s;
// it under the terms of the GNU Lesser General Public License as published by

import java.awt.image.BufferedImage;

public class Main {
    /**/*from  w  w w.j av  a2  s .  c o m*/
     * Create a copy of this BufferedImage.
     * 
     * @param image
     *            the image to create a copy of.
     * @return a duplicate.
     */
    public static BufferedImage duplicate(BufferedImage image) {
        BufferedImage copy = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());
        copy.getGraphics().drawImage(image, 0, 0, null);
        return copy;
    }
}

Related

  1. declareNewBufferedImage(int x, int y)
  2. declareNewBufferedImageAndCopy(BufferedImage img)
  3. depalettize(BufferedImage img, int maxBytes)
  4. determineBackgroundColor(BufferedImage bim)
  5. doInGraphics(final BufferedImage image, final Consumer consumer)
  6. DuplicateBufferedImage(BufferedImage bi)
  7. duplicateImage(BufferedImage image)
  8. dye(BufferedImage image, Color color)
  9. ensureIntRGB(final BufferedImage img)