matlab code for automated images slideshow?

3 次查看(过去 30 天)
hi all, i want images sledeshow in my gui but make sure that images slides must be change automatically..kindly help

采纳的回答

Shivaputra Narke
Shivaputra Narke 2014-2-1
Hope this helps... imgNameList=char('camerman.tif','Image.jpg','image2.jpg'); pause on; for i=1:length(imgNameList) a=imread(imgNameList(i,:)); imshow(a); drawnow; pause(1); end
%%% the above code runs only once %% better you use timer .

更多回答(2 个)

Mischa Kim
Mischa Kim 2014-2-1
Romasha, have you checked out this entry in the File Exchange?

Shivaputra Narke
Shivaputra Narke 2014-2-1
% if you want to use with timer %% create a timer %%% create a new file with following code and name it as main .
global indx indx=1; showTimer=timer('timerFcn',@slideshow); set(a,'ExecutionMode','fixedRate'); set(a,'Period',2) %% 2 sec delay start(a)
%%% create a function function slideshow(varargin) global indx imgNameList= char('img1.tif','img2.tif','img3.tif'); indx=indx+1; if indx> length(imgNameList) indx=1; end imshow(a); drawnow;
%%% Now run main file
  5 个评论
romasha
romasha 2014-2-1
i did as u said but there is an error
Error: main Undefined function or variable 'a'.
Error in main (line 3) set(a,'ExecutionMode','fixedRate');
>>

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by