Skip to content

Instantly share code, notes, and snippets.

@chaonan99
Created April 6, 2016 03:42
Show Gist options
  • Save chaonan99/ba9638d1c04d86e2deb547fe8f30ceac to your computer and use it in GitHub Desktop.
Save chaonan99/ba9638d1c04d86e2deb547fe8f30ceac to your computer and use it in GitHub Desktop.
A simple demo of screen capture using Matlab and java AWT
robo = java.awt.Robot;
t = java.awt.Toolkit.getDefaultToolkit();
rectangle = java.awt.Rectangle(t.getScreenSize());
image = robo.createScreenCapture(rectangle);
filehandle = java.io.File('capture.png');
javax.imageio.ImageIO.write(image,'png',filehandle);
im = imread('capture.png');
imshow(im);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment