1. To begin simple digital video capturing, create an instance of the ltmmCapture class. This is accomplished using the Win32 CoCreateInstance function as follows:
C Source
IltmmCapture* pCapture;CoCreateInstance(&CLSID_ltmmCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmCapture, (void**) &pCapture);
C++ Source
IltmmCapture* pCapture;CoCreateInstance(CLSID_ltmmCapture, NULL, CLSCTX_INPROC_SERVER, IID_IltmmCapture, (void**) &pCapture);
2. Define video devices to be used as the capture source. The ltmmCapture object contains video device collection objects. The first video device can be selected for capture by calling the device collections put_Selection function:
C Source
IltmmDevices* pDevices;// get an interface into video devices collectionIltmmCapture_get_VideoDevices(pCapture, &pDevices);// select the first video deviceIltmmDevices_put_Selection (pDevices, 0);// release collectionIUnknown_Release(pDevices);
C++ Source
IltmmDevices* pDevices;// get an interface into video devices collectionpCapture->get_VideoDevices(&pDevices);// select devicepDevices->put_Selection(0);// release collectionpDevices->Release();
3. Now start capturing, as demonstrated with the following code:
C Source
// start capturingIltmmCapture_StartCapture(pCapture, ltmmCapture_Mode_VideoOrAudio);
C++ Source
// start capturingpCapture->StartCapture (ltmmCapture_Mode_VideoOrAudio);
4.At the end, stop capturing and recording, as demonstrated with the following code:
C Source
// stop capturingIltmmCapture_StopCapture(pCapture);
C++ Source
// stop capturingpCapture->StopCapture ();
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
