C# 视频监控系列(8):服务器端——预览和可被客户端连接
2009-04-08 08:23:42 来源:WEB开发网VideoWin.cpp的OnPaint方法
StartVideoPreview(&dc);
VideoWin.cpp的StartVideoPreview方法
for(int i = 0; i < GetTotalDSPs(); i++){
StopVideoPreview(ChannelHandle[i]);
}
RECT previewWnd;
GetClientRect(&previewWnd);
//CDC *pDC = GetDlgItem(IDC_VIDEOWIN)->GetDC();
CBrush tempBrush(RGB(10, 10, 10));
CBrush *oldBrush = dc->SelectObject(&tempBrush);
dc->Rectangle(&previewWnd);
dc->SelectObject(oldBrush);
int rectWidth = previewWnd.right - previewWnd.left;
int rectHeight = previewWnd.bottom - previewWnd.top;
int numRects = GetTotalDSPs();
ZeroMemory(rectList, sizeof(rectList));
numRects = CacRects(GetTotalDSPs());
for(i = 0; i < GetTotalDSPs(); i++){
if(bDdrawMode)
::StartVideoPreview(ChannelHandle[i], m_hWnd, &rectList[i], FALSE, vdfRGB16, 25);
else
::StartVideoPreview(ChannelHandle[i], m_hWnd, &rectList[i], FALSE, vdfYUV422Planar, 25);
}
1.2. 代码分析
更多精彩
赞助商链接