MATLAB Function Reference
  Go to function:
    Search    Help Desk 
getframe    Examples   See Also

Get movie frame

Synopsis

Description

getframe returns a column vector containing one movie frame. The frame is a snapshot (pixmap) of the current Axes.

M = getframe gets a frame from the current Axes.

M = getframe(h) gets a frame from the Figure or Axes graphics object identified by h.

M = getframe(h,rect) specifies a rectangular area from which to copy the pixmap. rect is relative to the lower-left corner of the Figure or Axes graphics object identified by h, in pixel units. rect is a four-element vector in the form [left bottom width height], where width and height define the dimensions of the rectangle.

[X,Map] = getframe(...) returns the frame as an indexed image matrix X and a colormap Map. In this case, h is a handle to a Figure or Axes object. You display the image matrix using image or imagesc.

Remarks

Usually, getframe is put in a for loop to assemble movie matrix M for playback using movie. To provide more efficient memory use, use moviein to allocate movie matrix M before building the movie. This generates an appropriate size matrix of zeros.

Note that M = getframe; returns the contents of the current Axes, exclusive of the axis labels, title, or tick labels. M = getframe(gcf); captures the entire interior of the current Figure window.

If you plan to convert the MATLAB movie to another format (such as QuickTime) and you want to include the axis labels in this new format, you should capture the Figure, not just the Axes. If you are using moviein to pre-allocate the movie matrix, be sure to specify the same Figure handle that you use with getframe.

Examples

Make the peaks function vibrate:

See Also

movie, moviein,qtwrite



[ Previous | Help Desk | Next ]