Import

The Import method allows to load image in any frame from external ShotGraph component.

Import Track,Frame,oShotGraph[,BgColor]

Parameters

Track
Specifies the zero-based track number. The negative value means target track.
Frame
Specifies the zero-based frame number to alter.
oShotGraph
Variable containing ShotGraph object.
BgColor
Optional. Specifies the color in the source image as hexadecimal string "RRGGBB". If track has no transparent background then all pixels in the source image having such color will be replaced with opaque track background. If parameter is not specified then no replacements will be made. If track has transparent background then all pixels in the source image having such color will be transparent. If parameter is not specified then all pixels in the source image having color matching the default transparent color for track will be transparent. See also SetBackgroundColor.


Note
Using this method you can alter separate frames on the fly using methods of ShotGraph component. ShotGraph is a COM component for creating new and modifying existing still images on the fly.
Example
This ASP code sample creates moving text on gray background. Every frame is drawn in ShotGraph imagespace then imported to frame content

<%
Response.ContentType = "image/gif"
Set ani = CreateObject("ShotGraph.GifAnimator")
Set g = CreateObject("shotgraph.image")

width = 468
height = 60
fontsize = 32
maxangle = 10
frames = 5
delay = 20
textstring = "Movement"

ani.AddTrack width,height,"cccccc"

g.CreateImage width,height,8
g.SetColor 0,&hcc,&hcc,&hcc
g.SetColor 1,0,0,0
g.SetBgColor 0
g.SetTextColor 1
g.FontSmoothing = 2
g.SetTextAlign "TA_CENTER","TA_BASELINE"
g.SetBkMode "TRANSPARENT"

for i=0 to frames-1
	g.FillRect 0,0,width,height
	g.CreateFont "Arial",0,fontsize,(frames/2-i)*maxangle*10/(frames-1),True,False,False,False
	g.TextOut width/2,height/2,textstring
	
	ani.AddFrame 0,1,delay
	ani.Import 0,ani.FramesCount(0)-1,g
Next

ani.Join
Response.BinaryWrite ani.Play("")
%>