How to use getframe without displaying the figure?
16 views (last 30 days)
Show older comments
Hi,
I am trying to use getframe without displaying the figure. I have read it is impossible because getframe needs the figure to be displayed. So the following code does not work:
figure('visible', 'off')
Do you have any idea how to do that? At least prevent the figure from popping up and display it "behind" the Matlab main window?
2 Comments
sam0037
on 13 Apr 2016
Hi,
I tried the following in MATLAB R2015b and R2016a and this worked fine where getframe was able to capture the figure without popping up the figure window.
f = figure('visible', 'off');
plot(rand(5))
F = getframe(gca);
Further to display the captured figure, see below:
figure;
imshow(F.cdata)
Can you share the reproduction code and the version of MATLAB you are working on?
Libor Vojacek
on 27 Oct 2017
Hi, it works fine. But I noticed it takes 4 TIMES longer when you DON'T VISUALIZE the output. Weird.
Answers (0)
See Also
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!