最近做毕业设计,要求对视频中进行人数统计。于是做了一个MFC程序,视图左边是一个media player控件,右侧是一个static控件。现在问题是:
1、在没有视频播放的时候,程序窗口size改变以后,这两个控件大小都可以改变,并且都可以进行重绘。
2、当视频播放的时候,改变程序窗口size以后,static控件不能刷新!
程序关键代码如下,请大家帮忙分析:void CCVDetSysView::OnDraw(CDC* pDC) 
{
// TODO: Add your specialized code here and/or call the base class. //////////////////////////////////////////////////////////////////////////
//
CImage img;
img.Load("20070823092733-1326.jpg");

// static控件中显示一幅图画

CRect tmpParRect;
CStatic* tmpFrame = (CStatic*)GetDlgItem(0x0011); tmpFrame->GetWindowRect(tmpParRect);
ScreenToClient(&tmpParRect);
HDC hdc = pDC->GetSafeHdc();
img.DrawToHDC(hdc, &tmpParRect); //////////////////////////////////////////////////////////////////////////
}
void CCVDetSysView::OnSize(UINT nType, int cx, int cy) 
{

CFormView::OnSize(nType, cx, cy);

//////////////////////////////////////////////////////////////////////////
// media player window

CRect tmpParRect;

tmpParRect.top = 10;
tmpParRect.left = 10;
tmpParRect.right =cx / 2 - 10;
tmpParRect.bottom = cy /2 - 10;

m_pWMPlayer->MoveWindow(tmpParRect);

//////////////////////////////////////////////////////////////////////////
// picture show window


tmpParRect.top = 10;
tmpParRect.left = cx / 2  + 10;
tmpParRect.right = cx - 10;
tmpParRect.bottom = cy / 2  - 10;

CStatic* tmpFrame = (CStatic*)GetDlgItem(0x0011);

tmpFrame->MoveWindow(tmpParRect);
Invalidate(TRUE);

}