专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 多媒体/流媒体开发

directshow 显示有黑边的有关问题

发布时间:2011-06-27 19:29:34 文章来源:www.iduyao.cn 采编人员:星星草
directshow 显示有黑边的问题!
C/C++ code
bool CDXGraph::SetWindow(HWND inWindow)
{
    mVideoWindow->put_Owner((OAHWND)inWindow);
    mVideoWindow->put_Visible(OATRUE);
    mVideoWindow->put_AutoShow(OATRUE);
    mVideoWindow->put_MessageDrain((OAHWND) inWindow);
    mVideoWindow->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
    return S_OK;
}
bool CDXGraph::SetDisplayWindow(HWND inWindow)
{    
    if (mVideoWindow)
    {
        
        RECT windowRect;
        GetClientRect(inWindow, &windowRect);

        HRESULT hr = NULL;
        
        LONG lVideoWidth, lVideoHeight, lNewWidth, lNewHeight, lWidth, lHeight;
        //Read the default video size
        hr = mBasicVideo->GetVideoSize(&lVideoWidth, &lVideoHeight);
        if (FAILED(hr))
        {
            mBasicVideo->Release();
            mVideoWindow->Release();
            return FALSE;
        }
        // Ignore the video's original size and stretch to fit bounding rectangle
        hr = mVideoWindow->SetWindowPosition(0,0,windowRect.right, windowRect.bottom );
        if (FAILED(hr))
        {
            return S_FALSE;
        }

        return S_OK;
    }
    return S_FALSE;
}

上面是我显示的代码!左右会出现黑边!求解

------解决方案--------------------

不懂,帮顶
------解决方案--------------------
有黑边正常的吧,如果视频比例和当前尺寸不符合,会自动填充的。
------解决方案--------------------
看代码没什么问题。
你的视频左右不会有黑边吧?
------解决方案--------------------
你确定原始视频没黑边?
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: