How to use getframe without displaying the figure?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
sam0037
am 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
am 27 Okt. 2017
Hi, it works fine. But I noticed it takes 4 TIMES longer when you DON'T VISUALIZE the output. Weird.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Animation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!