[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 of 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 BeginAnimStream()
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. This can either be one
of the following animation types or an anim saver provided by a plugin:
#ANMFMT_GIF:Colors
and Dither tags to specify the number of palette entries to allocate for
the frame and whether or not dithering shall be applied. When using #ANMFMT_GIF
with a palette frame, no quantizing will be done. #ANMFMT_GIF also supports
palette anims with a transparent pen. #ANMFMT_GIF is the default format used
by BeginAnimStream().
#ANMFMT_MJPEG:Quality tag (see below) to control the level of compression
that should be used.
#ANMFMT_IFF:Colors and Dither tags
to specify the number of palette entries to allocate for the frame and whether
or not dithering shall be applied. When using #ANMFMT_IFF with a palette frame, no
quantizing will be done. #ANMFMT_IFF also supports palette anims with a transparent
pen. (V9.0)
The optional table argument allows you to configure further parameters:
Quality:
FPS:
Adapter:
UserTags: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.
#ANMFMT_GIF)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.