Share via


IMSVidVideoRenderer::put_ClippedSourceRect Method

This topic applies to Windows XP or later.
The put_ClippedSourceRect method specifies the clipping rectangle on the video source.

Syntax

HRESULT put_ClippedSourceRect(
  [in]  IMSVidRect *pRect
);

Parameters

  • pRect [in]
    Pointer to an IMSVidRect interface that specifies the rectangle.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

If the current clipping mode is sslClipByClipRect, the VMR clips the video image to the video source rectangle and stretches this to fill the Video Control's video window. For more information, see IMSVidVideoRenderer::put_SourceSize.

Examples

The following example clips the video image to the upper left corner of the source rectangle.

CComPtr<IMSVidVideoRenderer> pVideo;
HRESULT hr = pVideoControl->get_VideoRendererActive(&pVideo);
if (SUCCEEDED(hr))
{
    long lWidth, lHeight;
    CComPtr<IMSVidRect> pRect;
    
    hr = pVideo->get_AvailableSourceRect(&pRect);
    pRect->get_Height(&lHeight);
    pRect->get_Width(&lWidth);
    pRect->put_Height(lHeight / 2);
    pRect->put_Width(lWidth / 2);
    pVideo->put_SourceSize(sslClipByClipRect);
    hr = pVideo->put_ClippedSourceRect(pRect);
}

Requirements

Header Declared in Dshow.h.
DLL Requires Quartz.dll.

See Also

IMSVidVideoRenderer Interface
IMSVidVideoRenderer::get_ClippedSourceRect

Send comments about this topic to Microsoft

Build date: 12/4/2008