File Exchange

image thumbnail

Snapshot

version 1.0.0.0 (3.28 KB) by Douglas Schwarz
Program to take screenshot of modal GUI figures.

2 Downloads

Updated 26 Apr 2006

View License

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.

Cite As

Douglas Schwarz (2021). Snapshot (https://www.mathworks.com/matlabcentral/fileexchange/10846-snapshot), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Douglas Schwarz

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

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'.

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!