This website has been designed for use with the FireFox browser. Please use FireFox to view this page.
The MapWebcamToWindow sub performs the following tasks
Retrieves
the name of the first available VFW driver.
Creates
a capture window, and attaches it to a given window handle.
Connects
the VFW driver to the capture window
Sets
the refresh rate to 15 frames per second
Initiates
the transfer of video between the VFW driver and capture window
Sets
the video format to 320x240
Moves
and stretches the capture window to 320 x 240 pixels
Finally, we provide our CloseWebcam function to perform the
cleanup
Sub CloseWebcam() capDriverDisconnect(lwndC)
EndSub
And that’s all there is to it! To test the application, just
plug in your webcam, turn off any other software that could be accessing it,
then run this program. Your webcam video feed should appear on the form