A Simple Webcam Program for .Net Framework and
QuickCam 4000
This is a very rudimentary Webcam program written in C#. It uses
Windows Image Acquisition (WIA) with .Net interop to grab images from a
QuickCam 4000, or possibly from other devices with WIA video support. It
lacks many of the customization options end users would want, but someone with
a C# compiler and just a little bit of programming experience would
likely be able to customize for specific needs.
The Basics:
-
It snaps still images from the QuickCam at a user customizable interval and
stores them in a local directory of raw images. These raw images are
retained for 1 week after which they are automatically deleted.
-
For each image, the current date and time are drawn into the lower left corner,
and this enhanced version of the image is placed in a web-accessible
location as a JPEG file. Any existing JPEG file already in that location
is overwritten.
-
When it is night time the program goes into a sleep mode, and no pictures are
taken until morning.
-
If the user specifies an archive directory, the program will copy one image per
day to that directory.
Limitations:
-
The definition of "night time" is for Seattle WA, and is built into the
program. A programmer would need to modify this.
-
Archiving happens once per day at 9 AM. A programmer would be needed to
change this.
-
It works well with a QuickCam 4000, but not the QuickCam 3000. The
problem with the 3000 is that the images are too small, and I don't know if WIA
can control that.. anyone?
Usage:
-
First create a dedicated directory for the raw images, and if you like,
another one for the archived images. IMPORTANT: The raw images
directory must be dedicated to the webcam, and not be used for any other
purpose. This is because the app will automatically
delete images in that directory which are more than 1 week old. In
particular, never use a common directory such as "My Pictures" to collect raw
images unless you want all your pictures deleted.
-
It's a console app. Run from a command line or batch file.
simplewebcam outdir interval destination [archivedir]
-
outdir: The dedicated local directory you
created where all the raw pictures will be stored for 1 week, then
deleted.
-
interval: Time between pictures in milliseconds. For
best results use a number like 15000 (15 seconds) or larger.
-
destination: File path and name of web accessible JPG
file. This should end in '.jpg' It may be a UNC path.
-
archivedir: If you specify this directory, one image
per day will be archived there. Do not use the same directory as
outdir.
-
To quit the program: press the Enter key.
Downloads:
Reference:
Back to my home page