Skip to content

SetTextOverlay_CustomVar

function

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 TextOverlay 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 overlay. VarIndex: index of the custom variable that has been set with SetTextOverlay_String (from 0 to 9)

VarText: text of the custom variable

E.g., to initialize the 2 text overlay strings that will 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.