CAnimateCtrl的奇怪问题

weiyan 2003-12-08 02:54:27
CAnimateCtrl m_animate;
m_animate.Create(WS_VISIBLE|ACS_CENTER,CRect(25,20,505,340),this,0);
m_animate.Open("d:\\g.avi");
m_animate.Seek(1);
m_animate.Close();
没有任何显示
但如果在第四行(m_animate.Seek(1);)后加入AfxMessageBox("");就可以显示出一帧的图像来,怎么回事?
...全文
38 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weiyan 2003-12-08
  • 打赏
  • 举报
回复
多谢多谢,明白了,偶加上一条语句m_animate.RedrawWindow();就可以了:)
踏岸寻柳 2003-12-08
  • 打赏
  • 举报
回复
mark
vcforever 2003-12-08
  • 打赏
  • 举报
回复
试一试下边这个

CAnimateCtrl cAnimCtrl;

// Create the animation control.
if (!cAnimCtrl.Create(WS_CHILD|WS_VISIBLE|ACS_CENTER,
CRect(10,10,100,100), pParentWnd, 1))
return false;

// Open the AVI file.
if (!cAnimCtrl.Open(_T("myavi.avi")))
return false;

// Pump message from the queue until the stop play message is received.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0) && (msg.message != WM_STOPCLIP))
{
switch (msg.message)
{
// Start playing from the first frame to the last,
// continuously repeating.
case WM_PLAYCLIP:
if (!cAnimCtrl.Play(0, -1, -1))
return false;
break;

// Show the first frame.
case WM_SHOWFIRSTFRAME:
if (!cAnimCtrl.Seek(0))
return false;
cAnimCtrl.RedrawWindow();
break;

// Show the last frame.
case WM_SHOWLASTFRAME:
if (!cAnimCtrl.Seek(-1))
return false;
cAnimCtrl.RedrawWindow();
break;
}

TranslateMessage(&msg);
DispatchMessage(&msg);
}

cAnimCtrl.Stop();
cAnimCtrl.Close();

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧