My First Capture (Visual FoxPro 6.0)
Using the following steps to create a Visual FoxPro 6.0 form and use MM Capture control to capture video data:
1. |
Start Visual FoxPro 6. |
2. |
If you didn’t install LEAD Multi-Media controls before, install them. On the Tools pull-down menu, choose Options… and go to the Controls tab. Click the ActiveX controls radio button. Mark the ltmmCaptureCtrl Class and click the Set As Default button, then click OK. |
3. |
Create a new blank form. On the Form controls toolbar, press the View Classes button and select ActiveX controls. Add the ltmmCaptureCtrl to your form and change its name to ltmmCaptureCtrl1. Size and position the control as you want it to appear at run time. |
4. |
Code the Form Init procedure as follows: |
&& select first video device
ThisForm.ltmmCaptureCtrl1.VideoDevices.Selection = 0
&& use preview
ThisForm.ltmmCaptureCtrl1.Preview = .T.
5. |
Add two buttons and name them as follows: | |
|
Name |
Caption |
|
btnStartCapture |
Start Capture |
|
btnStopCapture |
Stop Capture |
6. |
Code the btnStartCapture Click procedure as follows. |
#define ltmmCapture_Mode_Video 2
ThisForm.ltmmCaptureCtrl1.StartCapture (ltmmCapture_Mode_Video)
7. |
Code the btnStopCapture Click procedure as follows. |
ThisForm.ltmmCaptureCtrl1.StopCapture ()
8. |
Run your program to test it. |
9. |
Save this form to use it as initial point for other tutorials. |