PDA

View Full Version : MV Text Overlay



Unregistered
August 30, 2005, 21:56:42
Can I pass the MVTextOverlay text string information from VB6. If so how? I am at my witts end.

Bernd Peretzke
August 31, 2005, 17:33:10
Hi,

create a filter graph with the workbench like this:

[videosource]->[MV Text Overlay]->[Video Renderer]

Create a VB project, add the MV Smart Control into the form and insert a reference to the MV Text Overlay Type library (menu: projects->References). The following code shows how to use the text overlay methods. Use the MV Demo Source as video source for example. The Text1 control in the code below is a TextBox control. The MV Text Overlay filter draws the text from the TextBox into the video stream. Therefore you have to setup the MV Text Overlay filter because the default text color ist black. Change the forground color, position, text size, ... and save the configuration for example into a overlay.mvp file.


Private Sub Form_Load()
On Error GoTo error

' Get filter graph interface from the MV Smart Control
Dim graph As IMVSCFilterGraph
Set graph = MVSmartControl.Object

' Load the project file
graph.LoadConfig App.Path + "\overlay.mvp"

' start the configuration
graph.Start

' Get the interface from the text overlay filter
Dim overlay As IMVTextOverlay
Set overlay = graph.GetFilter("MV Text Overlay")

' Get the current overlay text and set the TextBox 'Text1'
Text1.Text = overlay.Text

Exit Sub
error:
End Sub

Private Sub Text1_Change()
On Error GoTo error

' Get filter graph interface from the MV Smart Control
Dim graph As IMVSCFilterGraph
Set graph = MVSmartControl.Object

' Get the interface from the text overlay filter
Dim overlay As IMVTextOverlay
Set overlay = graph.GetFilter("MV Text Overlay")

' Set the overlay text from the TextBox to the MV Text Overlay
overlay.Text = Text1.Text

Exit Sub
error:
End Sub


Regards
Bernd