SetTextOverlay_CustomVar
Delphi
procedure SetTextOverlay_CustomVar (Index: LongInt; VarIndex: LongInt; VarText: string);
C++Builder
void __fastcall SetTextOverlay_CustomVar(System::LongInt Index, System::LongInt VarIndex, System::UnicodeString VarText);
C#
public void SetTextOverlay_CustomVar(int Index, int VarIndex, string VarText);
VB.NET
Public Sub SetTextOverlay_CustomVar(Index As Integer, VarIndex As Integer, VarText As String)
C++/Qt
void SetTextOverlay_CustomVar (int Index, int VarIndex, wchar_t *VarText);
Sets a custom variable displayed in the string of the specified text overlay. Setting custom variables is faster than rewriting the full text overlay string, because it saves TVideoGrabber from having to parse it again.
Parameters:
-
Index: index of the text overlay.
-
VarIndex: index (from 0 to 9) of the custom variable used in the string set with SetTextOverlay_String.
-
VarText: text of the custom variable.
For example, to initialize the 2 text overlay strings that use custom variables:
' ...
VideoGrabber.SetTextOverlay_String (0, "my first text uses %custom0%")
VideoGrabber.SetTextOverlay_Left (0, 10)
VideoGrabber.SetTextOverlay_Top (0, 10)
VideoGrabber.SetTextOverlay_Enabled (0, true)
VideoGrabber.SetTextOverlay_String (1, "my second text uses %custom3% and %custom4%")
VideoGrabber.SetTextOverlay_Left (1, 20)
VideoGrabber.SetTextOverlay_Top (1, 100)
VideoGrabber.SetTextOverlay_Enabled (1, true)
VideoGrabber.StartPreview
' ...
Then, to update the custom variables of the 1st text overlay string:
' ...
VideoGrabber.SetTextOverlay_CustomVar (0, 0, "value 0")
' ...
And those of the 2nd text overlay string:
' ...
VideoGrabber.SetTextOverlay_CustomVar (1, 3, "value 3")
VideoGrabber.SetTextOverlay_CustomVar (1, 4, "value 4")
' ...
See also SetTextOverlay_String.