首页 > 代码库 > 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中循环显示图片