日期:2014-05-17 浏览次数:20948 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Globalization;
using System.IO;
namespace GetAVIFrames
{
public partial class Form1 : Form
{
public const int BMP_MAGIC_COOKIE = 19778;
[DllImport("avifil32.dll")] public static extern void AVIFileInit();
[DllImport("avifil32.dll")] public static extern int AVIFileOpen(ref int ppFile, String szFile, int Mode, int pclsidHandler);
[DllImport("avifil32.dll")] public static extern int AVIFileGetStream(int pFile, out IntPtr ppAvi, int fccType, int lParam);
[DllImport("avifil32.dll")] public static extern int AVIStreamStart(int pavi);
[DllImport("avifil32.dll")] public static extern int AVIStreamLength(int pavi);
[DllImport("avifil32.dll")] public static extern int AVIStreamInfo(int pAVIStream, ref AVI_STREAM_INFO pStrInfo, int Size);
[DllImport("avifil32.dll")] static extern int AVIFileInfo(int pFile, ref AVI_FILE_INFO aviInfo, int Size);
[DllImport("avifil32.dll")] static extern int AVIStreamGetFrameOpen(IntPtr pAvi, ref BITMAPINFOHEADER bih);
[DllImport("avifil32.dll")] public static extern int AVIStreamGetFrame(int pGetFrame, int Pos);
[DllImport("avifil32.dll")] public static extern int AVIStreamGetFrameClose(int pGetFrame);