Problems using ICDraw.
-
My problem is that when i try to use ICDraw, nothing happens. I've done exactly what the MSDN says, but it's not working :( Here's my code:
DWORD dw;
DWORD dwNumBuffers = 0;ICDrawBegin(hVideo, ICDRAW_FULLSCREEN, NULL, NULL, NULL, 0, 0, 0, 0, &VideoInfo.bmiHeader, 0, 0, VideoInfo.bmiHeader.biWidth, VideoInfo.bmiHeader.biHeight, VideoHeader.dwRate, VideoHeader.dwScale);
avi.ReadNextVideoFrame(lpData, VideoInfo.bmiHeader.biWidth * VideoInfo.bmiHeader.biHeight * 24 / 8, VideoInfo.bmiHeader.biCompression);
ICGetBuffersWanted(hVideo, &dwNumBuffers);
for (dw = 0; dw < dwNumBuffers; dw++)
{
ICDraw(hVideo, 0, (LPVOID)&VideoInfo.bmiHeader, lpData, VideoInfo.bmiHeader.biWidth * VideoInfo.bmiHeader.biHeight * 24 / 8, dw);
}ICDrawStart(hVideo);
dw = 0;for (int i = 1; i < (int)((float)VideoHeader.dwRate / VideoHeader.dwScale * 60); i++)
{
avi.ReadNextVideoFrame(lpData, VideoInfo.bmiHeader.biWidth * VideoInfo.bmiHeader.biHeight * 24 / 8, VideoInfo.bmiHeader.biCompression);
ICDraw(hVideo, 0, (LPVOID)&VideoInfo.bmiHeader, lpData, VideoInfo.bmiHeader.biWidth * VideoInfo.bmiHeader.biHeight * 24 / 8, dw);}
ICDrawStop(hVideo);
ICDrawFlush(hVideo);
ICDrawEnd(hVideo);The avi.ReadNextVideoFrame() is a function that reads the next videoframe from the avifile. I'm not sure i'm doing it right, i don't think the MSDN illustrates very clearly how to do it. Thanks all! -Rune Svendsen