Java BufferedImage Operation DuplicateBufferedImage(BufferedImage bi)

Here you can find the source of DuplicateBufferedImage(BufferedImage bi)

Description

Duplicate Buffered Image

License

BSD License

Declaration

public static BufferedImage DuplicateBufferedImage(BufferedImage bi) 

Method Source Code

//package com.java2s;
// LICENSE:       This file is distributed under the BSD license.

import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;

public class Main {
    public static BufferedImage DuplicateBufferedImage(BufferedImage bi) {
        ColorModel cm = bi.getColorModel();
        boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();
        WritableRaster raster = bi.copyData(null);
        return new BufferedImage(cm, raster, isAlphaPremultiplied, null);
    }//from   www  . ja  va2 s.  c o m
}

Related

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