Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PAVIFILE pfile;
AVIFILEINFO pfi;
PAVISTREAM pavi;
LPBITMAPINFOHEADER lpbi;
PGETFRAME pgf;
HDRAWDIB hdd;
CDC *pDC = m_imgView.GetDC();
HDC hdc = pDC->GetSafeHdc();
CRect r;
int frameInMsecs = 0, samples = 0, result = 0;
AVIFileInit();
//m_strFile = name of AVI file
result = AVIFileOpen(&pfile, m_strFile, OF_READ, NULL);
result = AVIFileInfo(pfile, &pfi, sizeof(pfi));
result = AVIFileGetStream(pfile, &pavi, streamtypeVIDEO, 0);
pgf = AVIStreamGetFrameOpen(pavi, NULL);
hdd = DrawDibOpen();
//loop here for all m_nFrame
//calculate frame rate
frameInMsecs = (int)((float)m_nFrame * 33.33f);
samples = AVIStreamTimeToSample(pavi, frameInMsecs);
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, samples);
//lpbi now holds bitmap header, color palletes, and rgb data
//you'll probably want to save the lpbi stuff to disk here
//the following just draws to the screen
DrawDibDraw(hdd, hdc,
0, 0, m_rView.right, m_rView.bottom,
lpbi, (LPVOID)((DWORD)lpbi + (DWORD)(lpbi->biSize) + (DWORD)(lpbi->biClrUsed)),
0, 0, lpbi->biWidth, lpbi->biHeight,
DDF_DONTDRAW | DDF_SAME_HDC);
DrawDibDraw(hdd, hdc,
0, 0, m_rView.right, m_rView.bottom,
lpbi, (LPVOID)((DWORD)lpbi + (DWORD)(lpbi->biSize) + (DWORD)(lpbi->biClrUsed)),
0, 0, lpbi->biWidth, lpbi->biHeight,
DDF_UPDATE | DDF_SAME_HDC);
//end loop
DrawDibClose(hdd);
result = AVIStreamGetFrameClose(pgf);
AVIStreamRelease(pavi);
AVIFileRelease(pfile);
AVIFileExit();