---- 3. 在Visual C++5.0中按Ctrl_W进入MFC ClassWizard,选择类名称为CMainFrame,ObjectIDs: ID_VIEW_BITMAP,Messa
From: Toni Martir <techni-web@pala.com>
To: Earl F. Glynn <EarlGlynn@att.net>
Subject: RE: How to extract a bitmap from an avi file
Date: Wednesday, January 20, 1999 4:32 AM
I have one example
pavi:PIFile;
pavis:PIStream;
pavisound:PIStream;
ob:PGetFrame;
pbmi:PBitmapInfoHeader;
Punter:PByte;
han,i:integer;
Desti:TCanvas;
microsperframe:integer;
principio,fin:integer;
if 0<>IFIleOpen(pavi,Pchar(FFilename),OF_READ,nil) then
Raise Exception.Create('No se pudo abrir el archivo');
Desti:=Canvas;
if IERR_NODATA=IFILEGetStream(pavi,pavis,streamtypeVIDEO,0) then
Raise Exception.Create('Error no hay pista de audio');
principio:=IStreamStart(pavis);
fin:=IStreamENd(pavis);
ShowMessage(IntToStr(IStreamLength(pavis)));
ob:=IStreamGetFrameOpen(pavis,nil);
if nil=ob then
Raise Exception.Create('Error en Frameopen');
han:=DrawDIBOpen;
try
microsperframe:=Trunc(1000000/(info.dwRate/info.dwScale));
DrawDIBStart(han,microsperframe);
DrawDIBStart(han,microsperframe);
i:=0;
if 0<>IStreamBeginStreaming(pavis,principio,fin,1000) then
Raise Exception.Create('Error n IBegin');
pbmi:=IStreamGetFrame(ob,i);
While pbmi<>Nil do
begin
Punter:=Pointer(Integer(pbmi)+pbmi^.biSize);
DRawDIBBegin(han,desti.handle,0,0,pbmi,pbmi^.biWidth,pbmi^.biheight,DDF_ANIM
ATE);
DrawDIBRealize(han,desti.handle,false);
DrawDIBDraw(han,desti.handle,0,0,pbmi^.biWidth,pbmi^.biheight,pbmi,Punter,0,
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-27468-5.html
而且进12海里了
螃蟹嘛还不错