110,538
社区成员
发帖
与我相关
我的任务
分享
[DllImport("...")]
[return: MarshalAs(UnmanagedType.I1)]
private static extern bool ST_GetImageFromVideo(string videoPath, ref IntPtr pBuf, ref uint nSize, ref int nWidth, ref int nHeight);
bool AviPlayer::GetImageFromVideo(const char* videoPath,char** pBuf,unsigned int& nSize,int& nWidth,int& nHeight )
{
m_sLastError="";
if (!openFile(videoPath))
{
return false;
}
*pBuf=new char[m_frameSize];
if(!getFrame(26,*pBuf))
{
delete *pBuf;
pBuf=NULL;
return false;
}
nSize=m_frameSize;
nWidth=m_video_width;
nHeight=m_video_height;
stop();
return true;
}