This code sample has been tested with Logitech QuickCam Pro 4000 and with Dimera 350C USB Camera (an ancient camera from the year 2000) both operating under Windows XP.
Also I tested the code with Microsoft LifeCam VS-6000 on Vista Business 64-bit PC (the picture below).
No ActiveX controls are required, actually not much of programming is required either. Two API functions, capCreateCaptureWindow and SendMessage do practically all the job. The FoxPro form hosts a child window (the capture window) connected to existing capturing driver.
The Microsoft Windows Image Acquisition (WIA) Automation Layer 2.0 is a full-featured image manipulation component that provides end-to-end image processing capabilities. The WIA Automation Layer makes it easy to acquire images on digital cameras, scanners, or Web cameras, and to rotate, scale, and annotate your image files.
Applications that use the WIA Automation LayerAPI require Windows XPService Pack 1 (SP1) or later. Earlier versions of Windows are not supported. You will need WIAAut.dll to use the WIA Automation Layer.
* * *
You may have several capture windows created and fed from different Video Sources. You can not feed two capture windows from same source.
For example, now I have two digital cameras connected through USB -- Dimera 350C and Logitech QuickCam -- and one more video source, ATI TV Wonder Pro card that receives TV channels through coaxial cable.
With slightly modified code I can create three capture windows, one for each video source. All three windows simultaneously display preview from their sources.
* * *
Window styles WS_SYSMENU, WS_CAPTION and WS_THICKFRAME applied to the capture window make it movable and resizable. WS_CHILD must be present in any combination of window styles.
Alex, I think I already tried those two and it did not work. Will give another try.
email@example.com | 2007-01-15 12:31:14
I have the complete program that you sent in June 2005 and it operate. But upon executing this program by means of a command button of a form selected from a option of menu of user, it don't show the image of video.
They could help me, thank you
help | 2007-06-22 09:03:34
Dear sir guide me to retrieve the saved image (.dib) and display in the form pls regards balu
A.M. | 2007-06-25 21:41:58
The SaveToDib method in the code above saves current frame in a DIB file.
In VFP8/9 such DIB file can be directly assigned to the Picture property of VFP Image control, no format conversion is required. The control will display the image.
As well such DIB image can be directly stored in General field of VFP table, for example:
CREATE CURSOR csTmp (filename C(30), imagedata G) APPEND BLANK REPLACE filename WITH 'GRAB_3G17JDE3.DIB' APPEND GENERAL imagedata FROM 'GRAB_3G17JDE3.DIB'