IWMEncSource.PreviewCollection

Windows Media Encoder SDK banner art

The PreviewCollection property retrieves a collection of preview objects for the source stream.

Syntax

IWMEncDataViewCollection = IWMEncSource.PreviewCollection

Parameters

This property takes no parameters.

Property Value

An IWMEncDataViewCollection object, which is a collection of preview objects.

Remarks

This property is read-only. A preview is a WMEncDataView object that renders content in a window before compression.

To display previews and postviews, you must add the Windows Media Encoder Preview Control reference to the project. For more information, see Programming in Visual Basic.

Example Code

' Create a WMEncoder object.
  Dim Encoder As WMEncoder
  Set Encoder = New WMEncoder
 
' Configure the encoding session including the input sources,
' the profile, and the output.

' Retrieve an IWMEncDataViewCollection object from the
' video source object to display a preview.
  Dim DVColl_Preview As IWMEncDataViewCollection
  Set DVColl_Preview = SrcVid.PreviewCollection

' Create a WMEncDataView object.
  Dim PreView As WMEncDataView
  Set PreView = New WMEncDataView

' Add the WMEncDataView object to the collection.
  Dim lPreviewStream As Long
  lPreviewStream = DVColl_Preview.Add(PreView)

' Start encoding.
  Encoder.Start

' Display the stream preview in a frame called PreviewFrame.
  PreView.SetViewProperties lPreviewStream, PreviewFrame.hWnd
  PreView.StartView (lPreviewStream)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also