CopyTrack
The CopyTrack method copies specified animation track into newly created track optionally applying transformations.
CopyTrack
Track,Transformation[,X][,Y]
Parameters
-
Track
-
Zero-based track number. Negative value means the target animation track.
-
Transformation
-
Kind of transformation being applied to a newly created track. The following values are defined:
| Value | Means |
| 0 | No transformation. The track content will just be copied |
| 1 | 90-degrees counter-clockwise rotation of newly created track content |
| 2 | 180-degrees rotation of newly created track content |
| 3 | 90-degrees clockwise rotation of newly created track content |
Also you can appy additional flags using bitwise or operation:
| Flag | Means |
| 4 | Flip content of track horizontally |
| 8 | Flip content of track vertically |
-
X
-
Optional. Additional horizontal shift of the copied image data into new track. Default value is 0.
-
Y
-
Optional. Additional vertical shift of the copied image data into new track. Default value is 0.
Notes
This method creates a new animation track and fills it with data from original track,
applying transformations. I.e. amount of animation tracks will be increased by one. The newly
created track will be the last track in the collection, so its number get be get as
(TracksCount - 1)
See also the TracksCount property.
Example
This code reads animated gif, copies its content using 180-degrees rotation and saves summary to new file
(error checks are omitted)
| Source image | Result |
 |  |
filename = "a1.gif"
new_filename = "zzz.gif"
Set g = CreateObject("shotgraph.gifanimator")
g.GetFileDimensions filename,width,height
' Increase height to hold two images: normal and rotated
g.AddTrack width,height * 2
g.Read filename,0,0,0
g.CopyTrack 0,2
g.Join
g.Play new_filename