2011-12-17 18 views

回答

1

屏幕上,這樣你就可以創建一個矩形,並把它傳遞給機器人截圖接受者:

//Design the rectangle 
Component c = somecomponent; 
Rectangle rect = new Rectangle(c.getLocation(), c.getSize()); 

    //Get the ScreenShot 
    Robot robot = new Robot(); 
    BufferedImage image = robot.createScreenCapture(rect); 
    ImageIO.write(image, "png", new File(fileName)); 
+0

我已經處理機器人類,但如果最小化應用程序會發生什麼 – 2011-12-17 14:56:28