I am trying to display a GIF image in my GUI, and it doesn’t work. It displays me a fake image (not a GIF, and with different colors).
I know there is an “Animated GIF” in File Exchange but I prefer something else :/
I tried the next code, but it doesn’t work:
function [] = GUI_400()
hFig = figure('Name','Simulation Plot Window','Menubar','none', 'Resize','off', 'WindowStyle','modal', 'Position',[300 300 1150 600]);
movegui(hFig, 'center');
hAxes = axes('Parent',hFig,'Units','pixels','Position',[362 242 424 359]); %# so the position is easy to define
image(imread('loading.gif', 'gif'),'Parent',hAxes); %# Plot the image
set(hAxes,'Visible','off', 'handlevisibility', 'off'); %# Turn the axes visibility off
end
this is my gif image:
http://desmond.imageshack.us/Himg822/scaled.php?server=822&filename=loadingoz.gif&res=landing
Thank you!
Here is an example of a GIF player:
EDIT
As I mentioned in the comments, the sample GIF image you posted is rather strange. Here are the changes to make it work. Inside the while loop, add the following immediately after the
set(hImg,'CData',..)line: