Share via


IWMEncSource.PostviewCollection

Windows Media Encoder SDK banner art

The PostviewCollection property retrieves a collection of postview objects for the source stream.

Syntax

IWMEncDataViewCollection = IWMEncSource.PostviewCollection;

Parameters

This property takes no parameters.

Property Value

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

Remarks

This property is read-only. A postview is a WMEncDataView object that renders content in a window after the content has been both compressed and decompressed. Postviews more closely approximate the appearance of the output in Windows Media Player.

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

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
  WMEncoder Encoder;
  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 postview.
  IWMEncDataViewCollection DVColl_Postview;
  DVColl_Postview = SrcVid.PostviewCollection;

// Create a WMEncDataView object.
  WMEncDataView Postview;
  Postview = new WMEncDataView();

// Add the WMEncDataView object to the collection.
  int lPostviewStream;
  lPostviewStream = DVColl_Postview.Add(Postview);

// Start encoding.
  Encoder.Start();

// Display the postview in a panel named PostviewPanel.
  Postview.SetViewProperties(lPostviewStream, (int)PostviewPanel.Handle);
  Postview.StartView(lPostviewStream); 
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also