java/swing屏幕截图代码

		try {
			Robot r;
			r = new Robot();
			BufferedImage bi=r.createScreenCapture(new Rectangle(0,0,800,600));
			File f=new File("d:\\b.png");
			ImageIO.write(bi, "png", f);
			
		} catch (AWTException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
 

 

你可能感兴趣的:(java,swing,F#)