Screen grab of figure axes.
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Jan
2012 年 4 月 26 日
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 件のコメント
Jan
2012 年 4 月 26 日
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.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!