JAVA截取全屏

    public BufferedImage captureFullScreen() {
        Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
        //屏幕宽度
        int screenWidth = (int) dimension.getWidth();
        //屏幕高度
        int screenHeight = (int) dimension.getHeight();
        //从x坐标为0,y坐标为0的位置开始截取(左上角)
        return robot.createScreenCapture(new Rectangle(0, 0, screenWidth, screenHeight));
    }
上一篇:Python爬虫之Beautiful Soup的用法


下一篇:如何在Android中获取ImageView / Bitmap的高度和宽度