Java Screen Capture captureScreen(final Rectangle screenRect)

Here you can find the source of captureScreen(final Rectangle screenRect)

Description

capture Screen

License

Open Source License

Declaration

public static BufferedImage captureScreen(final Rectangle screenRect) throws AWTException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;

public class Main {
    private static Robot robot;

    public static BufferedImage captureScreen(final Rectangle screenRect) throws AWTException {
        if (robot == null) {
            throw new AWTException("the platform configuration does not allow low-level input control");
        }// ww  w  .ja va2 s  . c o m
        return robot.createScreenCapture(screenRect);
    }
}

Related

  1. captureScreen()
  2. captureScreen(Rectangle rect)
  3. captureScreen(String filename)
  4. screenshot(Rectangle dims, Robot r)
  5. screenShot(String format)