Syntax Highlighing:
comments, key words, predefined symbols, class members & methods, functions & classes
print("START");
numeric w;
numeric h;
w = 128;
h = 128;
class Color color;
color.red = 100;
color.green = 50;
color.blue = 50;
#Create Frame
print("Create Frame");
class Frame frameB;
frameB = FrameCreate(2*w,2*h);
class Frame frameS;
frameS = FrameCreate(w,h);
#Create GC From Frame
print("Create GC From Frame");
class GC gc;
gc = FrameCreateGC(frameS);
ActivateGC(gc);
SetColor(color);
print("The small frame is", FrameGetHeight(frameS),"x", FrameGetWidth(frameS));
print("The big frame is", FrameGetHeight(frameB),"x", FrameGetWidth(frameB));
# Create Movie
print("Create Movie");
class Movie movie;
movie = MovieInit();
# Set Movie Parameters
print("Set Movie Parameters");
MovieSetFormat(movie,"AVI");
MovieSetFrameRate(movie,"MOVIE_FRAMERATE_24");
MovieSetFrameWidth(movie,2*w);
MovieSetFrameHeight(movie,2*h);
# Make Output File
string ext$;
ext$ = MovieGetFileExt(movie);
string filename$;
filename$ = GetOutputFileName("","Make filename for movie",ext$);
printf("Filename = %s\n",filename$);
numeric numFrames;
numFrames = 5 * 24;
MovieStart(movie,filename$);
# Create the movie duplicating the small frame in the big one
numeric i;
for i = 1 to (numFrames / 2) {
SetStatusMessage(sprintf("Processing frame %d of %d",2*i,numFrames));
FillCircle(w / 2, h / 2, i);
FrameCopy(frameS,frameB,0,0,w,h,0,0);
FrameCopy(frameS,frameB,0,0,w,h,w,0);
FrameCopy(frameS,frameB,0,0,w,h,0,h);
FrameCopy(frameS,frameB,0,0,w,h,w,h);
MovieAddFrame(movie,frameB);
}
MovieStop(movie);
DestroyGC(gc);
MovieExit(movie);
FrameDestroy(frameB);
FrameDestroy(frameS);
print("END");