WMEncoder.WatermarkCollection
The WatermarkCollection property retrieves watermark information as an IWMEncWatermarkCollection object.
Syntax
IWMEncWatermarkCollection = WMEncoder.WatermarkCollection(enumSourceType)
Parameters
enumSourceType
[in] Specifies a member of the WMENC_SOURCE_TYPE enumeration type. This value can only be WMENC_AUDIO or WMENC_VIDEO.
Property Value
An IWMEncWatermarkCollection object that contains a collection of watermarks.
Remarks
This property is read-only.
Example Code
' Create a WMEncoder object.
Dim Encoder As WMEncoder
Set Encoder = New WMEncoder
' Configure the encoding session, including the sources, output, and
' profile.
' Declare variables and create objects to hold the audio and video
' watermark collections.
Dim WMCollAud As IWMEncWatermarkCollection
Dim WMCollVid As IWMEncWatermarkCollection
Set WMCollAud = Encoder.WatermarkCollection(WMENC_AUDIO)
Set WMCollVid = Encoder.WatermarkCollection(WMENC_VIDEO)
' Retrieve the number of audio and video watermarks in the registry.
Dim lWatercountAud As Long, lWatercountVid As Long
lWatercountAud = WMCollAud.Count
lWatercountVid = WMCollVid.Count
' Declare variables for the name of the audio watermark, the name of the
' video watermark, the configuration file, and a placeholder for a CLSID.
Dim sAudioWatermark As String
Dim sVideoWatermark As String
Dim sWatermarkConfig As String
Dim vWatermarkID As Variant
' Retrieve the name of the first audio watermark in the collection.
sAudioWatermark = WMCollAud.Item(0, vWatermarkID)
' Retrieve the name of the first video watermark in the collection.
sVideoWatermark = WMCollVid.Item(0, vWatermarkID)
' Specify the location of the watermark configuration file.
sWatermarkConfig = "REPLACE WITH A PATH AND FILENAME"
' Set the audio and video watermarks into the WMEncoder object.
Encoder.SetWatermark WMENC_AUDIO, 0, sAudioWatermark, _
vWatermarkID, sWatermarkConfig
Encoder.SetWatermark WMENC_VIDEO, 0, sVideoWatermark, _
vWatermarkID, sWatermarkConfig
Requirements
Reference: Windows Media Encoder
Library: wmenc.exe
See Also