Movie Maker Timeline Control

AddTextClip2 Method

Description

Add a text to the timeline. (for VB6 or another development tools does not support color data type)
You should call SetVideoTrackResolution method before call AddTextClip2 method. The text quality will depend the current video track resolution.

Syntax

Public Function AddTextClip 2( _
   ByVal trackIndex as integer, _
   ByVal text as string, _
   ByVal clipStartTime as float, _
   ByVal clipStopTime as float, _
   ByVal font as integer, _
   ByVal x as integer, _
   ByVal y as integer, _
   ByVal red as integer, _
   ByVal green as integer, _
   ByVal blue as integer
 ) As Integer

 

Parameter

trackIndex
   0 - Transition Track
   1 - Video 1 Track
   2 - Video 2 Track
   3 - Image Track
   4 - Effect Track
   5 - Audio 1 Track
   6 - Audio 2 Track
   7 - Text Track

text
    the string of text

clipStartTime
    Time in seconds when the clip will start on the timeline

clipStopTime
    Time in seconds when the clip will end on the timeline.

font
    the font handle.
 
x
    Specifies the logical x-coordinate of the starting point of the text.

y
    Specifies the logical y-coordinate of the starting point of the text.

red
    The color value with red component of text color (0-255).

green
    The color value with green component of text color (0-255).

blue
    The color value with blue component of text color (0-255).


Return Value

Return value is the clip index of the newly added clip if successful.
Return -1 , the string of text is empty.
Return -3 , the clipStartTime >= clipStopTime.
Return -4 , the track not found.
Return -5 , the unknown error.
 

Example

Visual Basic Syntax
TimelineControl1.SetVideoTrackResolution 720, 480
iCurrentClipIndex= TimelineControl1.AddTextClip2(7,"This is my text", 0, 30, FontDialog1.Font.ToHfont(), 10, 20, 255,0,0)