Posted By

whitetiger on 11/09/06


Tagged

image jpg java filter images Converter RGB j2me gray dilate bit planes screenshot snapshot


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

hkmd
toukubo
vkolev
studioevoque
kubaitis


Java - ScreenShot


 / Published in: Java
 

  1. import java.awt.Rectangle;
  2. import java.awt.Robot;
  3. import java.awt.Toolkit;
  4. import java.awt.image.BufferedImage;
  5. import java.io.File;
  6.  
  7. import javax.imageio.ImageIO;
  8.  
  9. public class screen2image
  10. {
  11. public static void main(String[] args) throws Exception
  12. {
  13. Robot robot = new Robot();
  14.  
  15. BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
  16. ImageIO.write(screenShot, "JPG", new File("screenShot.jpg"));
  17. }
  18. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: varra on June 26, 2011

Coool ..... Nice tip .. !

You need to login to post a comment.