Problem with getframe and R2014b

1 次查看(过去 30 天)
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.
  2 个评论
matt dash
matt dash 2014-12-10
You might check out some of the getframe replacements on the file exchange. I have a simple one named getscreen that uses a screenshot capability in java. Yair Altman has one named screencapture that has a lot more features.
Adam Simonsen
Adam Simonsen 2015-12-29
Does anybody know if this problem (GUI elements disappearing when using getframe) has been solved in later MATLAB releases ?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by