Here you can find the source of open(BufferedImage image)
Parameter | Description |
---|---|
image | a parameter |
public static void open(BufferedImage image) throws Exception
//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); } }