首页 > 代码库 > mfc中循环显示图片
mfc中循环显示图片
UINT CPalmIdentDlg::UpdateCImg(LPVOID p){ struct params *pa = (struct params*)p; int *imgarray = pa->imgArray; CStatic *m_StaticCImg = pa->ImgCtrl; int *count = (pa->count); //CDC* pdc = pa->pdc; //if (pdc==NULL) AfxMessageBox(_T("erro")); CRect rect; m_StaticCImg->GetClientRect(&rect); CDC dcMem; dcMem.CreateCompatibleDC(m_StaticCImg->GetDC()); CBitmap appBgImage; BITMAP bitmapInfo; while(1) { if (*count < 16) { appBgImage.Detach(); appBgImage.LoadBitmap(imgarray[*count]); *count = *count +1; } else { *count = 0; } appBgImage.GetBitmap(&bitmapInfo); dcMem.SelectObject(&appBgImage); m_StaticCImg->GetDC()->StretchBlt(0, 0, 100, 100, &dcMem, 0, 0, bitmapInfo.bmWidth, bitmapInfo.bmHeight, SRCCOPY); //dcMem.Detach(); //appBgImage.DeleteObject(); Sleep(150); } dcMem.DeleteDC(); return 0;}
mfc中线程相关操作:
http://www.360doc.com/content/14/0218/12/7267612_353478380.shtml
mfc中循环显示图片
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。