Directshow开发的基本技巧[7]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 aoosang 的 blog

hresult hr = g_pwc->getnativevideosize(&lwidth, &lheight, null, null);

if (succeeded(hr))

{

    rect rcsrc, rcdest;

    // set the source rectangle.

    setrect(&rcsrc, 0, 0, lwidth/2, lheight/2);

   

    // get the window client area.

    getclientrect(hwnd, &rcdest);

    // set the destination rectangle.

    setrect(&rcdest, 0, 0, rcdest.right/2, rcdest.bottom/2);

   

    // set the video position.

    hr = g_pwc->setvideoposition(&rcsrc, &rcdest);

}

处理窗口消息

因为vmr没有自己的窗口,所以当视频需要重画或者改变的时候你要通知它。

1 当你接到一个wm_paint消息,你就要调用ivmrwindowlesscontrol::repaintvideo来重画视频

本文关键:Directshow开发的基本技巧
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top