Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws NativeHookException, InterruptedException, AWTException, FileNotFoundException {
- robot = new Robot();
- //GlobalScreen.registerNativeHook();
- //GlobalScreen.addNativeKeyListener(new GlobalKeyListenerExample());
- int width = Toolkit.getDefaultToolkit().getScreenSize().width;
- int height = Toolkit.getDefaultToolkit().getScreenSize().height;
- Rectangle rect = new Rectangle(width,height);
- BufferedImage capture = robot.createScreenCapture(rect);
- JFrame window = new JFrame("Pixel Box");
- window.setVisible(false);
- window.setSize(width, height);
- window.setLocation(0,0);
- for(int x = 0;x<width;x++)
- {
- for(int y = 0;y<height;y++)
- {
- Color rgb = new Color(capture.getRGB(x,y));
- window.add(new Representation(x,y,1,1,rgb,width,height));
- }
- }
- window.setVisible(true);
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement