IBasicVideo2 Object

Note  This topic is deprecated. It applies to Visual Basic 6.0. DirectShow is not supported for Visual Basic .NET or C#.

The IBasicVideo2 object supports the video component of the filter graph. To use this object, declare a variable of type IBasicVideo2 and set it equal to the FilgraphManager object:

Dim mGraph As New FilgraphManager
Dim iVideo As IBasicVideo2
Set iVideo = mGraph

If the graph does not have a connected video renderer, all IBasicVideo2 properties and methods return run-time error 521. Properties set on a video renderer generally persist between successive connections and disconnections.

The IBasicVideo2 object manipulates the following rectangles associated with the video image:

  • The source rectangle is the portion of the original image that gets displayed.
  • The destination rectangle is the portion of the video window the receives the source rectangle.
  • The video rectangle is the original video image.

In other words, the video renderer crops the image to the source rectangle, and then stretches or shrinks the cropped image to the destination rectangle.

Include a reference in your project to "ActiveMovie control type library" (Quartz.dll).

The IBasicVideo object exposes the following properties and methods.

Property Description
AvgTimePerFrame Retrieves the average time between successive frames.
BitErrorRate Retrieves the approximate bit error rate of the video stream.
BitRate Retrieves the approximate bit rate of the video stream.
DestinationHeight Sets or retrieves the height of the destination rectangle.
DestinationLeft Sets or retrieves the x-coordinate of the destination rectangle.
DestinationTop Sets or retrieves the y-coordinate of the destination rectangle.
DestinationWidth Sets or retrieves the width of the destination rectangle.
SourceHeight Sets or retrieves the height of the source rectangle.
SourceLeft Sets or retrieves the x-coordinate of the source rectangle.
SourceTop Sets or retrieves the y-coordinate of the source rectangle.
SourceWidth Sets or retrieves the width of the source rectangle.
VideoHeight Retrieves the video height.
VideoWidth Retrieves the video width.


Method Description
GetCurrentImage Not supported.
GetDestinationPosition Retrieves the destination rectangle.
GetPreferredAspectRatio Retrieves the preferred aspect ratio.
GetSourcePosition Retrieves the source rectangle.
GetVideoPaletteEntries Retrieves the color palette entries required by the video.
GetVideoSize Retrieves the native video dimensions.
IsUsingDefaultDestination Not supported.
IsUsingDefaultSource Not supported.
SetDefaultDestinationPosition Reverts to the default destination rectangle.
SetDefaultSourcePosition Reverts to the default source rectangle.
SetDestinationPosition Sets the destination rectangle.
SetSourcePosition Sets the source rectangle.




Send comments about this topic to Microsoft

Build date: 8/31/2010