why doesn't the 'getframe' work?

c_H=figure; H_axes=axes('parent', c_H); Z= hadamard(20); figure(c_H) % pause(1) pcolor(Z) pause(1) f = getframe(H_axes); figure,image(f.cdata)
I am confused,the last picture is nothing.But if I comment the figure(c_H),the code is right. I appreciate who can tell me why.

 채택된 답변

Friedrich
Friedrich 2011년 12월 19일

0 개 추천

Hi,
seems like an openGL issue. Changing the renderer to painters or zbuffer or opengl software works:
c_H=figure;
H_axes=axes('parent',c_H);
Z= hadamard(20);
figure(c_H)
pcolor(Z)
%set(c_H,'Renderer','painters') %or
%opengl software %or
set(c_H,'renderer','zbuffer')
pause(1)
f = getframe(H_axes);
figure,image(f.cdata)

댓글 수: 1

buaa
buaa 2011년 12월 19일
thank you very much. It's done. But the 'painters' is so slow,I used 'zbuffer'.
thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2011년 12월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by