//myvideo 播放器 Microsoft.DirectX.AudioVideoPlayback的video类
//引用interop.dexterlib.dll
//filepath 视频文件名Video myvideo=new Video();
MediaDetClass mediaDet = new MediaDetClass();
mediaDet.Filename = filepath;
unsafe
{
Size s = myvideo.DefaultSize;//视频原始尺寸
int bmpinfoheaderSize = 40; //equals to sizeof(CommonClasses.BITMAPINFOHEADER);
int bufferSize = (((s.Width * s.Height) * 24) / 8) + bmpinfoheaderSize;
IntPtr frameBuffer = System.Runtime.InteropServices.Marshal.AllocHGlobal(bufferSize);
byte* frameBuffer2 = (byte*)frameBuffer.ToPointer();
mediaDet.GetBitmapBits(myvideo.CurrentPosition, ref bufferSize, ref *frameBuffer2, s.Width, s.Height);
Bitmap bmp = new Bitmap(s.Width, s.Height, s.Width * 3,
System.Drawing.Imaging.PixelFormat.Format24bppRgb,
new IntPtr(frameBuffer2 + bmpinfoheaderSize));
bmp.RotateFlip(RotateFlipType.Rotate180FlipX);
System.Runtime.InteropServices.Marshal.FreeHGlobal(frameBuffer);
bmp.Save(@"d:\a.bmp");
}