how do i take picture from a digital camera attached to my computer throught USB cable using vb.net or asp.net or C#?


Question

I am writing picture editing windows forms application using vb.net/c#. i have a client requirement to capture the photo from digital still camera attached to computer.

how can i capture a photo from USB connected digital still camera device in my windows application ?

1
6
9/16/2008 6:54:13 PM

Accepted Answer

If you use the Windows Image Acquisition Library, you'll see events there for capturing camera new picture events. I had a similar requirement and wrote a test rig; we went down to the local camera store and tried every camera they had. The only cameras we could find that supported this functionality were the Nikon D-series cameras.

We found that with most cameras, you can't even take a picture when they are plugged in. When you plug them in to the USB port, most cameras will switch into a mode where the only thing they'll do is transfer data. The quick way to find out if a camera will work at all is to plug it into a PC, then try to snap a picture. If it lets you do that you have a chance. It also needs to support PTP.

5
3/1/2009 3:21:46 PM

This is depend on the interface the camera exporting. If this is standard mass storage interface you just use standard file interface, i.e you will see the camera as removable disk and can use standard Create/Read/Write/File operation.
Many new cameras have ptp (Picture transport protocol) interface. So you will need using Windows Image Acquisition API.

You might find useful following Link. If i understand correctly this is a sample code for exactly what are you looking for. Google is your friend :)

Another piece of info: many cameras will support both mass storage and ptp interfaces and it will be selectable by camera user interface. In case of automatic mode camera probably will switch to ptp interface.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon