Creation of a gif from the capture of a portion of an animation in a GUI

I have a GUI with an integrated plot that represents the movement of a point in function of time.The movement of the point is known from a file which provides the point coordinates (x,y) in function of time.
I use a slide bar to choose the time instant to plot. Moving the slide bar updates the plotted point location.
My goal is to save in a gif the movement of the point for a given time segment (not the whole file duration).
To do so, I would like to use a toggle button (I accept other suggestions!). It should be working this way:
- When pressed, it should start the 'capture mode', ie the plot is captured at the time indicated by the slide bar. When moving the slide bar, I should be capturing different time instants/point locations.
- When unpressed, it should create the gif file using imwrite
My concern is to figure out how can I capture each plot,knowing that:
  • I work with two screens and I manipulate my GUI in the secondary screen. Everytime, I move the created GUI manually to the secondary screen. There is where I want to manipulate it. getframe, does not work for me in this case
  • At each image capture I want to capture the plot exclusively, not the rest of the GUI

Answers (0)

Categories

Asked:

on 31 Jul 2013

Community Treasure Hunt

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

Start Hunting!