Java BufferedImage Operation open(BufferedImage image)

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

Description

Writes image to disk and opens in default editor

License

Open Source License

Parameter

Parameter Description
image a parameter

Declaration

public static void open(BufferedImage image) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Desktop;

import java.awt.image.BufferedImage;

import java.io.File;
import javax.imageio.ImageIO;

public class Main {
    /**//w w w  . java  2s. c o  m
     * Writes image to disk and opens in default editor
     * 
     * @param image
     */
    public static void open(BufferedImage image) throws Exception {
        File file = File.createTempFile("gscrot", ".png");
        ImageIO.write(image, "png", file);

        Desktop.getDesktop().open(file);
    }
}

Related

  1. newSubimage(BufferedImage src, int x, int y, int w, int h)
  2. nNeighbors(BufferedImage image, int i, int j)
  3. nrChannels(BufferedImage img)
  4. numPixelsDifferent(BufferedImage imgA, BufferedImage imgB)
  5. offset(final BufferedImage image, final float[] scales, final float[] offsets)
  6. openAsBufferedImage(String path)
  7. operatedImage(BufferedImage source, BufferedImageOp op)
  8. optimizeForGraphicsHardware(BufferedImage image)
  9. optimizeForGraphicsHardwareIfRequired(BufferedImage image)