mfc中循环显示图片

时间:2023-03-09 17:05:35
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()
{ if (*count < )
{
appBgImage.Detach();
appBgImage.LoadBitmap(imgarray[*count]);
*count = *count +;
}
else
{
*count = ;
} appBgImage.GetBitmap(&bitmapInfo);
dcMem.SelectObject(&appBgImage);
m_StaticCImg->GetDC()->StretchBlt(, , , , &dcMem, , , bitmapInfo.bmWidth, bitmapInfo.bmHeight, SRCCOPY);
//dcMem.Detach();
//appBgImage.DeleteObject();
Sleep();
}
dcMem.DeleteDC();
return ;
}

mfc中线程相关操作:

http://www.360doc.com/content/14/0218/12/7267612_353478380.shtml