[id] = BeginAnimStream(id, file$, width, height[, format, table])
BeginAnimStream()over SaveAnim() is that SaveAnim() requires you to provide an animation object as the source. If you use
BeginAnimStream(), you can append frames to your animation from individual brush objects. This gives you the utmost flexibility. Because of its sequential design,
BeginAnimStream()can be used to create new animations for virtually unlimited size and length. You could easily create a 2 hour AVI video with this function.
The first argument to
BeginAnimStream() must be an id for the new write
animation object. Alternatively, you can specify Nil and
will return a handle to the object to you. The second argument specifies
a path to a file that shall be created for this anim. Arguments three
and four specify the desired dimensions of the animation. The fifth
argument specifies the format of the animation. The animation can
currently be exported either as a GIF ANIM (limited to 256 colors) or
as an AVI file using Motion JPEG compression. To save a GIF ANIM, use
#ANMFMT_GIF as format; to save an AVI, use
The optional table argument allows you to configure further parameters:
Here is a table that shows an overview which table elements can be used with the different animation formats:
When you have successfully obtained a handle to a new animation object, you can then sequentially append frames to it using WriteAnimFrame(). When you are done adding frames, you have to call FinishAnimStream() to finalize the animation file on disk and make it ready for use.
CreateBrush(1, 320, 240) SelectBrush(1) SetFillStyle(#FILLCOLOR) BeginAnimStream(1, "test.gif", 320, 240) For Local k = 1 To 100 Circle(#CENTER, #CENTER, k * 2, #RED) WriteAnimFrame(1, 1) Next FinishAnimStream(1) EndSelectThe code above creates a new GIF animation with 100 frames. The animation will show a red circle zooming into the screen.