I have set the 'EraseMode' property of my figure to 'none' in order to retain points that I have already drawn. When I use the GETFRAME function to capture the image, only the last area that was drawn is captured. For example, try:
axis([0 10 0 10]);% Set up a triangle patch with 'EraseMode' set to 'none'
V = [0 0 0; 0.5 1 0; 1 0 0];F = [1 2 3];p1 = patch('vertices',V,'faces',F,'EraseMode','none','facecolor','r');% Make more triangles by moving the existing triangle
for i=1:10 set(p1,'vertices',V); drawnow; V = V+1;end% Now capture the image
im = getframe(gcf);clf;image(im.cdata);set(gca,'position',[0 0 1 1])
I expect the image to include all of the triangle locations, as it appeared on the screen when GETFRAME is called, rather than containing only the last triangle.
Best Answer