Here you can find the source of duplicate(BufferedImage image)
Parameter | Description |
---|---|
image | the image to create a copy of. |
public static BufferedImage duplicate(BufferedImage image)
//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; } }