Board index » cppbuilder » AVI->BMPs
Mark Dutc
![]() CBuilder Developer |
Sat, 19 Jul 2003 10:51:51 GMT
|
Mark Dutc
![]() CBuilder Developer |
Sat, 19 Jul 2003 10:51:51 GMT
AVI->BMPs
I want to take an AVI file and extract individual bitmaps. Can someone
please tell me how to go about this in BCB4? TIA |
Wenderson Teixeir
![]() CBuilder Developer |
Sun, 20 Jul 2003 19:52:01 GMT
Re:AVI->BMPsQuote"Mark Dutch" <ma...@intermtech.com.au> wrote in message Quote> I want to take an AVI file and extract individual bitmaps. Can someone // ------------------------------------------------------------------------- Quote} int bmpsave(const char *fname, LPBITMAPINFOHEADER pbmih) { int s, x, y; BITMAPFILEHEADER bmfh; FILE *fp; x = pbmih->biWidth; bmfh.bfType = 0x4d42; if (pbmih->biClrUsed == 0) case 4: case 8: case 24: case 16: bmfh.bfOffBits += sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); case 4: case 8: case 16: case 24: case 32: bmfh.bfSize = bmfh.bfOffBits + (s + 3) / 4 * 4 * y; bmfh.bfSize = bmfh.bfOffBits+pbmih->biSizeImage; if ((fp = fopen(fname, "wb")) == NULL) return fclose(fp); Quote} ----- void __fastcall TForm1::Button1Click(TObject *Sender) { LPBITMAPINFOHEADER pbmih; PAVIFILE pavi; PAVISTREAM pstm; PGETFRAME pfrm; AVIFileInit(); if (AVIFileGetStream(pavi, &pstm, 0, 0) != 0) if ((pfrm = AVIStreamGetFrameOpen(pstm, NULL)) == NULL) if ((pbmih = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pfrm, 7)) == NULL) if (bmpsave("TEST01.BMP", pbmih) != 0) if (AVIStreamGetFrameClose(pfrm) != 0) AVIStreamRelease(pstm); Quote} |
Mark Dutc
![]() CBuilder Developer |
Mon, 21 Jul 2003 06:28:47 GMT
Re:AVI->BMPsThanks Wenderson. I'll try your code. Regards, Mark. |
Mark Dutc
![]() CBuilder Developer |
Mon, 28 Jul 2003 11:22:51 GMT
Re:AVI->BMPsQuoteWenderson Teixeira wrote: Wenderson, I have tried to use your code but get many errors. Kind Regards, |
Christophe Minett
![]() CBuilder Developer |
Wed, 30 Jul 2003 00:59:16 GMT
Re:AVI->BMPsQuote> Wenderson, I have tried to use your code but get many errors. Try to include #include <vfw.h> Regards Christophe |
Mark Dutc
![]() CBuilder Developer |
Wed, 30 Jul 2003 06:18:02 GMT
Re:AVI->BMPsQuoteChristophe Minetti wrote: Kind Regards, Mark Dutch |
Mark Dutc
![]() CBuilder Developer |
Wed, 30 Jul 2003 06:40:04 GMT
Re:AVI->BMPsBy the way Christophe, where do I find help on the VFW stuff?? The code snippet Wenderson provided definitely extracted a bitmap, but I want to break down the whole avi into bitmaps. For this I need more info on the individual functions called. Regards, Mark Dutch |
Stuart Langle
![]() CBuilder Developer |
Wed, 20 Aug 2003 22:00:24 GMT
Re:AVI->BMPsIt's included with BCB3 Pro, you can also look on the Microsoft msdn site for information. Regards, Stuart Quote"Mark Dutch" <ma...@intermtech.com.au> wrote in message Quote> By the way Christophe, where do I find help on the VFW stuff?? The code |