AddTrack
The AddTrack method adds a new animation track to tracks collection.
AddTrack
Width,Height[,BgColor]
Parameters
-
Width
-
Specifies width of every image on the track.
-
Height
-
Specifies width of every image on the track.
-
BgColor
-
Optional. Specifies the opaque background color that every image on the track will have.
The colors are specified as character string of hexadecimal data "RRGGBB".
If this parameter is not specified then new animation track will have transparent
background.
Return value
The method returns new total amount of tracks hosted by GifAnimator object.
Notes
If you have more than one animation tracks in the GifAnimator object then it is recommended
to use transparent background in the second, third etc. tracks.
The first added track becomes background and defines the width and height of next tracks
and, therefore, defines width and height of final compiled animated gif.
Just after creation the animation track contains no frames. You can add frames to tracks
either using AddFrame or Read method.
Example
The code sample creates a new track with 100x100 frames with opaque background and
fills this animation track with frames from gif file. Every frame on the track will
be on solid background. The result will be old gif animation on new (solid) background.
Set ani = CreateObject("shotgraph.gifanimator")
ani.AddTrack 100,100,"00aa00"
ani.Read filepath
ani.Join
ani.Play new_file