I'm streaming video to my Window Form with DirectShowLib. I also want to save image when i press button "Save" for example. How to get picture from webcam with DirectShowLib methods or with WIN32 API methods?
DirectShow.NET Samples are there: http://sourceforge.net/projects/directshownet/files/DirectShowSamples/2010-February/ The following sample demoes the requested function:
Samples\VMR9\vMR9Snapper ------------------------ This sample shows how to capture bitmaps from VMR9.
Having it working with other renderer might require small code modifications.
The question also discussed a multitude of times at MSDN Forums, and on CodeProject, e.g. how to save bmp file from IVMRWindowlessControl9->GetCurrentImage().
来源:https://stackoverflow.com/questions/7887910/take-picture-from-webcam-c-sharp