How to achieve that getframe doesn't rise the figure above the other ones?
Show older comments
Hi! I'm using the function getframe to save a plot as a matrix. It's working fine but, there is a very annoying problem. Every time I call the function, it rises the figure in question above all the other ones and this is not right for me... I have tried with set(0,'CurrentFigure',3) before f=getframe(3); but it doesn't work... :(
Any help?
Thankyou
Answers (2)
Walter Roberson
on 24 Jan 2012
1 vote
Yes, getframe() must do that on MS Windows machines.
Jan
on 24 Jan 2012
0 votes
You can omit the lifting of the figure, but then GTEFRAME replies the contents of the screen at the position of the figure. This is most likely not the wanted behaviour.
See print for a method to save the contents of a figure without the need to bring it to the top.
3 Comments
Josep
on 25 Jan 2012
Walter Roberson
on 25 Jan 2012
getframe() is not likely to change on MS Windows machines. Perhaps the situation will improve in the eventual MATLAB 8.x with Handle Graphics 2 (HG2), perhaps not.
Jan
on 25 Jan 2012
If you are really careful, you can use the undocumented function HARDCOPY, which is does the screen capture for PRINT also. HARDCOPY replies the screen contents as array, but it crashs brutally if e.g. any object has an EraseMode different from 'normal'.
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!