TrackPlay

The TrackPlay function saves the content of animation track into animated GIF

TrackPlay sFileName [,iBgColor]

Parameters

sFileName
Specifies the file name to write the animated GIF to. If file name is zero length string, the resulting binary data will be output as array suitable for Response.BinaryWrite method

iBgColor
Optional. Specifies the declared background color of the image. If omitted, the zero value is supposed.

Return value

The function returns the array of binary data if sFileName parameter is zero-length string.
Example
View result

<%
Response.ContentType="image/gif"
set obj=CreateObject("shotgraph.image")
xsize=320
ysize=240
frames=9
obj.CreateImage xsize,ysize,4
obj.SetColor 0,255,255,51
obj.SetColor 1,0,0,0
obj.SetColor 2,204,0,0
obj.SetBgColor 0
obj.SetDrawColor 1
obj.SetBkMode "TRANSPARENT"
obj.SetTextColor 2
obj.SetTextAlign "TA_CENTER","TA_BASELINE"
obj.FillRect 0,0,xsize-1,ysize-1
obj.TrackLoop 0
obj.TrackAdd 0,0,0,0,0,xsize,ysize,30
step=ysize\frames\2-1
for i=1 to frames
obj.FillRect 0,0,xsize-1,ysize-1
obj.Ellipse xsize\2-step*i,ysize\2-step*i,xsize\2+step*i,ysize\2+step*i
obj.CreateFont "Arial",0,40*i\frames,3600*(i-1)\(frames-1),True,False,False,False
obj.TextOut xsize\2,ysize\2,"Animation"
obj.TrackAdd 0,xsize\2-step*i,ysize\2-step*i,xsize\2-step*i,ysize\2-step*i,step*i*2+1,step*i*2+1,30,"BACKGROUND"
next
Response.BinaryWrite obj.TrackPlay("")
%>
Looking for example's result you see what text is slightly garbaged, because we did not call anti-aliasing functions like WebPalette and BuildPalette. It has been done to make the example simpler. To create an aligned palette in your image you should use the local clipboard capablilties in addition to anti-aliasing methods.