Multiple “File Exchange” Animated GIF codes work for R2010a but not for R2011a
1 回表示 (過去 30 日間)
古いコメントを表示
All of the matlab figure to animated GIF codes on the matlab file exchange that I have tested so far will work for Matlab version 7.10.0.499 (R2010a) but not for Matlab version 7.12.0.635 (R2011a). Two examples are http://www.mathworks.com/matlabcentral/fileexchange/21944-animated-gif and http://www.mathworks.com/matlabcentral/fileexchange/21407-gifaddframe. I have the Image Processing Toolbox for the 2011 version but not the 2010 version. Any suggestions?
4 件のコメント
Walter Roberson
2012 年 7 月 9 日
Hmmm, some kind of change in what happens when you snapshot, it sounds like.
There is a possibility that if you set the figure Renderer property to something else that the behavior might change. Also, if you are using the opengl renderer, try using "opengl software" to switch to software rendering.
Jan
2012 年 7 月 9 日
Whenever you write something like "does not work" in the forum, more details are obligatory. Either the error message or a description of the difference between the results and your expectation is required, because it is impossible to guess such details.
@Walter: While I do not suffer from the term "urgent", it hurts me to read "it does not work". It's like: "Hey, I have a problem you could solve, but I do not tell it!".
採用された回答
その他の回答 (2 件)
Jan
2012 年 7 月 9 日
編集済み: Jan
2012 年 7 月 9 日
You need a pause(0.02) before getframe.
A drawnow is not enough. With pause(0.01) there are still some dropouts, but less, while I did not observe any problem with 0.02 seconds on a Core2Duo Win7/64 even under high system load.
When this does not help, and there are some Matlab/Java/OS combinations which worked better, but not perfect, with pause(0.1), try this:
fig_Paperposmode = get(aFigH, 'PaperPositionMode');
fig_PaperOrient = get(aFigH, 'PaperOrientation');
fig_Invhardcopy = get(aFigH, 'InvertHardcopy');
set(aFigH, ...
'PaperPositionMode', 'auto', ...
'PaperOrientation', 'portrait', ...
'InvertHardcopy', 'off');
print(aFigH, '-dpng', '-r0', FileName);
% Restore properties of the original image:
set(aFigH, ...
'InvertHardcopy', fig_Invhardcopy, ...
'PaperPositionMode', fig_Paperposmode, ...
'PaperOrientation', fig_PaperOrient);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Animation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!