Screen grab of figure axes.
2 views (last 30 days)
Show older comments
I'm developing a GUI that deals with image processing. When I want to view results with greater detail I have the 2 output images popup in a new figure, side by side, each within its own imscrollpanel and then a immagbox and imoverviewpanel. I can zoom in/out and pan in either subplot and the other syncs nicely. But now I'd like to take a snapshot of the area I'm seeing and I'm trying
frame = getframe(h);
image = frame2im(frame);
but it's not working as expected. if I do figure, imshow(image);
I get gibberish. getframe behavior seems erratic and often It captures not only the intented axes but also a lot more around it or only to one side of it... I am using opengl hardware and opengl renderer. I'm forced to do this because I need transparency and correct rendering in large images...
Anyone else having this problem or have any suggestions? Thanks in advance.
0 Comments
Answers (2)
Jan
on 26 Apr 2012
I had some success by adding a pause(0.02) before getframe(). This seems to allow some syncronizations of the underlying Java objects. drawnow was not sufficient, because it fails sometimes to update the display fast enough.
2 Comments
Jan
on 26 Apr 2012
Does this mean that you have tried the PAUSE command and it does not help? I had success with PAUSE(0.02) even for objects which have been drawn minutes before.
See Also
Categories
Find more on Visual Exploration 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!