Animation in GUI

5 visualizaciones (últimos 30 días)
Indira Iyer
Indira Iyer el 30 de Nov. de 2011
Comentada: Adam Danz el 26 de Mayo de 2020
Is there a way to load an animation (.gif/.mov) into a GUI? Maybe loading it onto axes or just as a background image.
  1 comentario
Adam Danz
Adam Danz el 26 de Mayo de 2020
Since this question continues to get many views years later, here's how to load GIF images to AppDesigner buttons.

Iniciar sesión para comentar.

Respuestas (2)

Fangjun Jiang
Fangjun Jiang el 30 de Nov. de 2011
imread() can read .gif files. For movies, only .avi files and MATLAB movie structure are supported. See aviread(), movie2avi().

Walter Roberson
Walter Roberson el 30 de Nov. de 2011
If the question is whether one can load an image that "plays itself", then the answer is NO.
MATLAB does not directly support displaying animated GIF files; you would have to convert them to movies.
You can use movie() to play movies, but I believe it is synchronous -- certainly there are no asynchronous controls.
I cannot seem to find any Mathworks video players with asynchronous controls -- though if you have the Computer Vision toolbox you could use http://www.mathworks.com/help/toolbox/vision/ref/vision.videoplayerclass.html and use something like a timer callback to schedule frames.
The Image Processing toolbox has implay() but no obvious ways asynchronous ways of controlling it.
The MATLAB File Exchange Contribution videofig might be your best bet, in that you could strip out what you do not need and add in an auto-repeat.

Categorías

Más información sobre Movie en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by