>>Edit MovieDemo
前半----
% Open a window
screenNumber=0;
pixelSize=8;
[window,windowRect]=Screen(screenNumber,'OpenWindow',[],[],pixelSize);
n=300;
% n=min(windowRect(RectBottom),2*round((Bytes*2-1e6)^0.33/2)); % make movie as big as memory will allow.
rect=[0 0 n n];
rect2=AlignRect(rect,windowRect,RectRight,RectBottom);
waitSecs(1); % Give display a moment to recover from the change of pixelSize
% Make a movie by drawing disks into 1+n/2 offscreen windows.
black=BlackIndex(window);
for i=1:(1+n/2)
w(i)=Screen(window,'OpenOffscreenWindow',[],rect);
w(n+2-i)=w(i);
r=[0 0 2 2]*(i-1);
Screen(w(i),'FillOval',black,r);
end
% Show the movie, first forwards, then backwards.
Screen(window,'TextSize',24);
Screen(window,'DrawText','Showing movie at priority 0 ...',10,30);
HideCursor;
for i=1:length(w)
Screen(window,'WaitBlanking');
s(i)=GetSecs;
Screen('CopyWindow',w(i),window,rect,rect2);
end
s=diff(s);
frames1=sum(s)*FrameRate(screenNumber)-length(s);
前半----
% Open a window
screenNumber=0;
pixelSize=8;
[window,windowRect]=Screen(screenNumber,'OpenWindow',[],[],pixelSize);
n=300;
% n=min(windowRect(RectBottom),2*round((Bytes*2-1e6)^0.33/2)); % make movie as big as memory will allow.
rect=[0 0 n n];
rect2=AlignRect(rect,windowRect,RectRight,RectBottom);
waitSecs(1); % Give display a moment to recover from the change of pixelSize
% Make a movie by drawing disks into 1+n/2 offscreen windows.
black=BlackIndex(window);
for i=1:(1+n/2)
w(i)=Screen(window,'OpenOffscreenWindow',[],rect);
w(n+2-i)=w(i);
r=[0 0 2 2]*(i-1);
Screen(w(i),'FillOval',black,r);
end
% Show the movie, first forwards, then backwards.
Screen(window,'TextSize',24);
Screen(window,'DrawText','Showing movie at priority 0 ...',10,30);
HideCursor;
for i=1:length(w)
Screen(window,'WaitBlanking');
s(i)=GetSecs;
Screen('CopyWindow',w(i),window,rect,rect2);
end
s=diff(s);
frames1=sum(s)*FrameRate(screenNumber)-length(s);