WriteText
The WriteText method draws text on the specified track and specified range of frames.
WriteText
Track,StartFrame,Amount,X,Y,Text,Font,Size,Color,Options
Parameters
-
Track
-
Zero-based track number. Negative value means the target animation track.
-
StartFrame
-
Zero-based start frame number.
-
Amount
-
Amount of frames to place text on.
-
X
-
X-coordinate of text relatively top-left corner of the image.
-
Y
-
Y-coordinate of text relatively top-left corner of the image.
-
Text
-
Text string
-
Font
-
Font name to draw text.
-
Size
-
Font size to draw text.
-
Color
-
Color of text as a string in hexadecimal form (RRGGBB) or empty string. The empty string means the
transparent color.
-
Options
-
Different flags to set text options. To have several flags applied to the text, use the bitwise or operation:
| Action | Value |
| bold | 1 |
| italic | 2 |
| underline | 4 |
strikeout | 8 |
Also the following flags are defined:
| Action | Value |
| Method doesn't draw text, it just returns text size | 256 |
Return value
The method returns length of text string, in pixels.
Example
This code reads animated gif, writes green text string over it and saves it under new filename:
Set g = CreateObject("shotgraph.gifanimator")
g.Read filename
g.Join
g.WriteText -1,0,g.FramesCount,0,0,"SAMPLE","Times New Roman",22,"00CC00",1
g.Play new_filename