Microsoft DirectX 9.0


This topic applies to Windows XP only.

The ClippedSourceRect property sets or retrieves the clipping rectangle on the video source.


objMSVidVideoRenderer.ClippedSourceRect As MSVidRect


This property takes no parameters.

Return Values

Returns an IMSVidRect object.


If the MSVidVideoRenderer.SourceSize property is sslClipByClipRect, the VMR clips the video image to the video source rectangle, and stretches the clipped image to fill the Video Control's video window. Otherwise, this property has no effect.

This property is read/write.

Example Code

The following example toggles between showing the entire video and showing the video zoomed in by a factor of two:

Private bClipped As Boolean

Private Sub ClipFrame_Click()
    Dim objVid As MSVidVideoRenderer
    Set objVid = VideoControl1.VideoRendererActive
    If (Not objVid Is Nothing) Then
        Dim objRect As IMSVidRect
        Set objRect = objVid.AvailableSourceRect

        If (Not bClipped) Then  ' Zoom in. 
            Dim h As Long, w As Long
            h = objRect.height
            w = objRect.width
            objRect.Top = h / 4
            objRect.Left = w / 4
            objRect.height = h / 2
            objRect.width = w / 2
        End If

        ' Otherwise, show the entire video.
        objVid.ClippedSourceRect = objRect
        objVid.SourceSize = sslClipByClipRect
        ' Toggle the state.
        bClipped = Not bClipped
    End If
End Sub

See Also