public static BufferedImage toCompatibleImage(final BufferedImage image) {
long now = System.currentTimeMillis();
final BufferedImage compatible = GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()
.getDefaultConfiguration()
.createCompatibleImage(image.getWidth(), image.getHeight(), image.getTransparency());
ColorConvertOp op = new ColorConvertOp(image.getColorModel().getColorSpace(), compatible.getColorModel().getColorSpace(), null);
op.filter(image, compatible);
return compatible;
FUENTE: http://www.java.net/node/693786
No hay comentarios:
Publicar un comentario