RSS feed

Linkedin Profile

Tags:
economy
programming
seattle
things that bug me
wall art

Posts by month: 12/08 (2)
10/08 (2)
08/08 (1)
06/08 (2)
05/08 (1)
03/08 (3)
02/08 (1)
01/08 (2)
12/07 (2)
11/07 (1)
07/07 (1)
05/07 (2)
02/07 (1)
01/07 (1)
12/06 (1)
11/06 (1)
10/06 (1)
08/06 (1)
07/06 (1)
06/06 (2)
05/06 (1)
04/06 (2)
02/06 (1)
01/06 (2)
12/05 (3)
11/05 (2)
09/05 (5)
08/05 (5)
07/05 (7)
06/05 (3)
05/05 (6)
04/05 (8)
03/05 (7)
02/05 (7)
01/05 (6)
12/04 (2)
11/04 (3)
10/04 (5)
09/04 (3)
08/04 (5)
07/04 (5)
06/04 (4)
05/04 (4)
04/04 (9)
03/04 (4)
02/04 (3)
01/04 (5)
12/03 (1)
11/03 (14)
10/03 (8)


Webcam
2007-05-30

I bought a cheap web cam at the supermarket on the weekend. After plugging it in I wondered how hard it would be to program. Particularly, I wondered if I could programmatically take pictures with the web cam and send the pictures up to my weblog along with the GPS information that already goes there. I figure so long as I have a database of everywhere I have been, I may as well have a database of what those places look like. And it was a long weekend, and it seemed like a good project for a long weekend...

The easiest way I found to automatically capture images on Windows is to use the API in avicap.dll. capGetDriverDescriptionA lets me enumerate attached devices and return a device name, which I can then pass to capCreateCaptureWindowA to creates a capture window, which I can then hook up to the web camera using a series of windows messages (sample code here and here. Not elegant (why do I need to create a window to capture some video?), but it works.

web cam photo

That's the view from my couch, btw. For the moment I'm storing these in a DB via a SOAP service, but I wonder if there is a nice GPS + photos + google maps mashup in the offing...

Tags: programming

Back to weblog