编程语言
首页 > 编程语言> > JAVA截取全屏

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));
    }

标签:JAVA,int,截取,screenHeight,全屏,屏幕,screenWidth,dimension
来源: https://blog.csdn.net/daiyi666/article/details/122383772