/ Published in: Java

This snippet will allow you to capture your screen in Java and saves the image as a PNG
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { // Captures the image from the screen // Writes the File as a PNG ImageIO.write(screencapture, "png", file); } }
Comments
