why doesn't the 'getframe' work?

2 views (last 30 days)
buaa
buaa on 19 Dec 2011
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.

Accepted Answer

Friedrich
Friedrich on 19 Dec 2011
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 Comment
buaa
buaa on 19 Dec 2011
thank you very much. It's done. But the 'painters' is so slow,I used 'zbuffer'.
thank you!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!