Code covered by the BSD License  

Highlights from
getscreen

4.0

4.0 | 1 rating Rate this file 20 Downloads (last 30 days) File Size: 2.69 KB File ID: #22031

getscreen

by matt dash

 

08 Nov 2008 (Updated 17 Nov 2008)

Replacement for getframe for multiple-monitor systems. Also takes screenshots of non-MATLAB windows.

| Watch this File

File Information
Description

GETSCREEN works just like the MATLAB function getframe, but works on any monitor, not just the primary one. (Getframe gives an error if you use it on a figure displayed on your second monitor) Can also be used to take screenshots from any area of your display, whether or not it is a MATLAB figure.

Syntax is the same as getframe, and can be used to capture entire figures or axes, or a rectangular subarea of these. Can also be called using just a position vector to take a screenshot of that area of your display, regardless of whether it is a MATLAB figure or not.

Uses java.awt.robot to take screenshots, so it requires java.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
screencapture

MATLAB release MATLAB 7.6 (R2008a)
Other requirements java. Only tested in Windows (xp and vista).
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
19 Dec 2008 Arturo Serrano

Thanks for the code. I found it just when a I needed it.
Just a point. I had to add
>> pause (0.01);
after drawnow.

12 May 2011 Enrique

Its a lot faster (3 mal in my computer) if you change the lines 113 - 118 (the Java to Matlab RGB conversion) to:

rasta = typecast(rasta, 'uint8');
X.cdata=zeros(h,w,3,'uint8');

I posted my own version of saurabh kumar screencapture script here
http://www.mathworks.com/matlabcentral/fileexchange/31383-screenshotrgb-make-a-screenshot-using-robot-java-class

12 May 2011 Enrique

3 mal = 3 times.
:)

Please login to add a comment or rating.
Updates
17 Nov 2008

updated inspired by

Tag Activity for this File
Tag Applied By Date/Time
image processing matt dash 09 Nov 2008 19:29:21
screenshot matt dash 09 Nov 2008 19:29:21
screen shot matt dash 09 Nov 2008 19:29:21
java matt dash 09 Nov 2008 19:29:21
getframe matt dash 09 Nov 2008 19:29:21
movie matt dash 09 Nov 2008 19:29:21
screen capture matt dash 09 Nov 2008 19:29:21
data import matt dash 09 Nov 2008 19:29:21
printscreen matt dash 09 Nov 2008 19:29:21
data import Cristina McIntire 10 Nov 2008 10:33:46
image processing Cristina McIntire 10 Nov 2008 10:33:56
data export Cristina McIntire 10 Nov 2008 10:48:04
screen shot Cole Stephens 02 Jul 2009 10:01:13
screenshot Colby Nyce 03 Aug 2009 16:05:10
data export Faisal 29 Jan 2012 22:38:10

Contact us at files@mathworks.com