← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #647616]: Problem with not recognized window borders in Linux

 

Question #647616 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/647616

Edmundo V. Neto posted a new comment:
I will take a look at the code.

By now I can say that createScreenCapture() method from Javas Robot
class do that. I have not coded in Java for years.

This is the simplest code that reproduces the problem:

import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.*;

public class Capture{
    public static void main(String args[]) { 

        try {
            Thread.sleep(3000);
            Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); 
            Robot robot = new Robot(); 
            BufferedImage img = robot.createScreenCapture(new Rectangle(size));
            File myNewPNGFile = new File("ImageAsPNG.png");
            ImageIO.write(img, "PNG", myNewPNGFile);
        } catch(Exception e) { 
        } 

    }
}

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.