- 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;}
上面是我显示的代码!左右会出现黑边!求解
------解决方案--------------------------------------------------------
不懂,帮顶
------解决方案--------------------------------------------------------
有黑边正常的吧,如果视频比例和当前尺寸不符合,会自动填充的。
------解决方案--------------------------------------------------------
看代码没什么问题。
你的视频左右不会有黑边吧?
------解决方案--------------------------------------------------------
你确定原始视频没黑边?