妻子出轨250次粤语:编程实现AVI转BMP的问题!
来源:百度文库 编辑:神马品牌网 时间:2024/05/06 10:25:00
已经实现了
使用VFW.H里的
AVIFileOpen
AVIFileInfo
...
这些函数把非压缩AVI专成一张一张的BMP.
但现在的问题时,抓出来的BMP图片失真比较严重,最右边的图象跑到了最左边
,并且上边有很多的条纹.这个是什么原因呢?
程序如下:
int main()
{
wchar_t aviFilename[256],bmpFilePath[256];
wcin >> aviFilename >> bmpFilePath;
wcout << aviFilename << endl;
AVIFileInit();
PAVIFILE pAvi;
int result = AVIFileOpen( &pAvi , aviFilename , OF_READ , NULL );
if ( result != AVIERR_OK )
{
wcout << " can't open file" << endl;
if ( pAvi != NULL )
AVIFileRelease( pAvi );
return 0;
}
AVIFILEINFO avi_info;
AVIFileInfo( pAvi , &avi_info ,sizeof( AVIFILEINFO )) ;
PAVISTREAM pStream;
result = AVIFileGetStream( pAvi , &pStream , streamtypeVIDEO , 0L );
if ( result != AVIERR_OK )
{
wcout << "can't get stream " << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
int iNumFrames;
int iFirstFrame;
iFirstFrame = AVIStreamStart( pStream );
if ( iFirstFrame == -1 )
{
wcout << " the first frame is -1" << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
iNumFrames = AVIStreamLength( pStream );
if ( iFirstFrame == -1 )
{
wcout << " the frame length is -1 " << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
使用VFW.H里的
AVIFileOpen
AVIFileInfo
...
这些函数把非压缩AVI专成一张一张的BMP.
但现在的问题时,抓出来的BMP图片失真比较严重,最右边的图象跑到了最左边
,并且上边有很多的条纹.这个是什么原因呢?
程序如下:
int main()
{
wchar_t aviFilename[256],bmpFilePath[256];
wcin >> aviFilename >> bmpFilePath;
wcout << aviFilename << endl;
AVIFileInit();
PAVIFILE pAvi;
int result = AVIFileOpen( &pAvi , aviFilename , OF_READ , NULL );
if ( result != AVIERR_OK )
{
wcout << " can't open file" << endl;
if ( pAvi != NULL )
AVIFileRelease( pAvi );
return 0;
}
AVIFILEINFO avi_info;
AVIFileInfo( pAvi , &avi_info ,sizeof( AVIFILEINFO )) ;
PAVISTREAM pStream;
result = AVIFileGetStream( pAvi , &pStream , streamtypeVIDEO , 0L );
if ( result != AVIERR_OK )
{
wcout << "can't get stream " << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
int iNumFrames;
int iFirstFrame;
iFirstFrame = AVIStreamStart( pStream );
if ( iFirstFrame == -1 )
{
wcout << " the first frame is -1" << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
iNumFrames = AVIStreamLength( pStream );
if ( iFirstFrame == -1 )
{
wcout << " the frame length is -1 " << endl;
if ( pStream != NULL )
{
AVIStreamRelease( pStream );
}
AVIFileExit();
return 0;
}
没看见这段代码中有转BMP的句子啊?楼主只贴了片断吧?