How to use getframe without displaying the figure?
Afficher commentaires plus anciens
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 commentaires
sam0037
le 13 Avr 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
le 27 Oct 2017
Hi, it works fine. But I noticed it takes 4 TIMES longer when you DON'T VISUALIZE the output. Weird.
Réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!