熟悉VFW的进来,如何控制视频预览的大小(在线等)
利用网上的代码做了一个视频采集的小程序,现在需要实现如下功能
已有如下函数:
/*******************************************************************************
Function : EnablePreviewVideo
Arguments : Parent (input) - Parent window that will display video.
x (input) - X Location in parent where video will be shown.
y (input) - Y location in parent where video will be shown.
Width (input) - Width of preview window.
Height (input) - Height of preview window.
PreviewRate (input) - Rate of preview in FPS.
Return : TRUE Success, FALSE Failed.
Description: Enables preview video mode.
*******************************************************************************/
BOOL CVFWImageProcessor::EnablePreviewVideo(HWND Parent, INT x, INT y, INT Width, INT Height, INT PreviewRate)
{
// Reset any error conditions.
GetPreviousError(NULL,NULL,TRUE);
SetParent(m_hWndVideo,Parent);
SetWindowLong(m_hWndVideo,GWL_STYLE,WS_CHILD);
SetWindowPos(m_hWndVideo,NULL,x,y,
Width,
Height,
SWP_NOZORDER);
ShowWindow(m_hWndVideo,SW_SHOW);
capPreviewRate(m_hWndVideo, PreviewRate);
return capPreview(m_hWndVideo,TRUE);
}
现在已经通过获取预览窗口CRect rectVideo的大小,但是视频显示的还是与视频格式设置大小一致,只能在窗口内显示视频左上角的一部分,没有实现视频的缩放,所以显示不全。我现在就想缩放视频预览显示到设定区域,但实际的视频大小不要改变,因为抓图还是要实际大小的。
哪位大侠熟悉视频窗口大小控制的帮忙啊,老大已经催着完工了,着急啊!