MATLAB Answers

Problem with getframe and R2014b

3 views (last 30 days)
Richard Kennaway
Richard Kennaway on 10 Dec 2014
Commented: Adam Simonsen on 29 Dec 2015
I have a rather complex GUI figure (hundreds of elements), and I am finding that with Matlab R2014b (but not previous versions), when I call getframe to take a snapshot of an axes object within it, many of the GUI elements vanish, including the axes (although the correct image is successfully saved). By stepping through getframe in the debugger, I've found that it happens when it calls alternateGetframe, which is an internal Matlab function with no source code available. This also happens when I call getframe directly from the command line, instead of from within my callbacks.
Switching the figure window from foreground to background or the reverse brings some of the GUI elements back, but not all of them. Inspecting all of the properties of the handles for the missing elements shows nothing unusual: according to the properties I see, they should all show up, but they don't.
I haven't managed to reproduce the problem with smaller examples. Is anything like this a known problem?
Pro tem, is there any way of telling R2014b to use the old handle graphics system? I notice that getframe.m contains code to detect which system is in use. If I execute the code in getframe that would be executed when useCaptureScreen is true, it works without problems.
Adam Simonsen
Adam Simonsen on 29 Dec 2015
Does anybody know if this problem (GUI elements disappearing when using getframe) has been solved in later MATLAB releases ?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!