Here you can find the source of deepCopy(BufferedImage image)
Parameter | Description |
---|---|
image | The image to copy |
public static BufferedImage deepCopy(BufferedImage image)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.WritableRaster; public class Main { /**//from www. j av a 2 s.com * Make a deep copy of a buffered image * * @param image The image to copy * @return A completely new copy */ public static BufferedImage deepCopy(BufferedImage image) { ColorModel cm = image.getColorModel(); boolean isAlphaPremultiplied = cm.isAlphaPremultiplied(); WritableRaster raster = image.copyData(null); return new BufferedImage(cm, raster, isAlphaPremultiplied, null); } }