Code covered by the BSD License  

Highlights from
Snapshot

2.0

2.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 3.28 KB File ID: #10846
image thumbnail

Snapshot

by Douglas Schwarz

 

24 Apr 2006 (Updated 26 Apr 2006)

Program to take screenshot of modal GUI figures.

| Watch this File

File Information
Description

Recently, while preparing a GUI function for submission to the file exchange I wanted to capture a screenshot, but I couldn't easily do it because the GUI function is modal and I couldn't run getframe from the command line. So, I wrote Snapshot. It facilitates taking a screenshot of a modal GUI figure or any other figure for that matter. It's very easy to use and the image is placed in a variable in the base workspace.

MATLAB release MATLAB 7.2 (R2006a)
Other requirements Tested on Windows XP and Mac OS X.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
19 Sep 2006 s md

This is an excellent idea, however the menu function faults. Multiple radio buttons can be chosen and that crashes Matlab. Just typing snapshot in Matlab results in the following errors
>> snapshot
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 145 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 176 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 196 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 202 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 207 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 215 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 226 Column: 9
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
Warning: File: C:\Documents and Settings\smd\Desktop\snapshot.m Line: 228 Column: 1
Unmatched "end".
(Type "warning off MATLAB:m_warning_end_without_block" to suppress this warning.)
??? Undefined function or variable 'var_name_ed'.

20 Sep 2006 Douglas Schwarz

S MD,
It looks as though you are using an older version of MATLAB that doesn't support nested functions.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Douglas Schwarz 22 Oct 2008 08:23:00
example Douglas Schwarz 22 Oct 2008 08:23:00
screen figure modal capture screenshot Douglas Schwarz 22 Oct 2008 08:23:00

Contact us at files@mathworks.com