Use ltmmCaptureCtrl to Perform Simple Still Image Capture (Visual FoxPro 6.0)
1. |
Start with the form that you created in My First Capture. | |
2. |
Add a Button control to your form, and name it as follows. | |
|
Name |
Caption |
|
btnGetFreeDIB |
Get and Free Captured Bitmap |
3. |
Update the btnStartCapture_Click procedure to be as follows. |
#define ltmmCapture_Mode_Still 6
ThisForm.ltmmCaptureCtrl1.StartCapture (ltmmCapture_Mode_Still)
4. |
Code btnGetFreeDIB Click procedure as follows. |
Declare Integer GlobalFree In kernel32 Integer hMem
hDIB = ThisForm.ltmmCaptureCtrl1.GetStillDIB (100)
If hDIB <> 0 Then
MessageBox("Operation done successfully")
GlobalFree(hDIB)
EndIf
5. |
Run your program to test it. |