Hello shabir... i have a question about picture loading...
i have build this engine which switches pictures on a Frame and i want it to be in a 25 fps rate, how can i be done?
here is my code:
BOOL MovieEngine::paintCurrFrame(BOOL onPaint)
hDC = ::BeginPaint(m_paintTarget->m_hWnd, &ps);
HDC memDC = CreateCompatibleDC(hDC);
m_jpegRect.bottom=m_offsetY+m_currFrame->GetHeight(); //m_currFrame is a cximage object
HBITMAP hMemBmp = CreateCompatibleBitmap(hDC, m_clientRect.Width(), m_clientRect.Height());
HBITMAP hOldBmp = (HBITMAP)SelectObject(memDC, hMemBmp);
BitBlt(hDC, 0, 0, m_clientRect.Width(), m_clientRect.Height(), memDC, 0, 0, SRCCOPY);
this is the engine itself as a thread:
UINT MovieEngine::playThread(LPVOID engine)
while (thisEngine->m_movieBuff.size()>0)//m_movieBuff is a vector of pointers to cximages (hance the movie).
thisEngine->paintCurrFrame(FALSE); //function above
Sleep(40);// 40 milisec is the time needed to get 25 fps rate but all the picture switching takes time, so i need 40-switch_time...
ofcourse there is a loading thread (to keep buffer full untill the movie ends) while playing but it is irelevant for now.
i hope the code is clear, couse i am new to mfc and visual at all.
i managed to make it play but nothing deterministic. sometimes it plays faster than 25 fps sometimes slower.... i donno what to do
Second year SE student.