Fog Creek Software
Discussion Board




ASP.NET and Digital Cameras

I need to create a web application that captures images from a digital camera connected on the USB port... can I do this with ASP.NET?  I know I can browse the pictures that have been uploaded from the camera, but I'd like to be able to use the raw feed from the camera and capture the image in the web app.

I would just use a webcam, but the powers that be have determined a digital camera will be best for this, because they need the mobility of the camera in some instances.

Any pointers are much appreciated.

nathan
Wednesday, August 18, 2004

If you can find a web browser which allows you to access arbitrary hardware on the client's machine like that, you should complain to the vendor. Seriously. What you are suggesting is not a good idea, and although it may be possible it shouldn't be.

That said, you might be able to make it work if the following conditions hold:

1. You have a specific client who wants this functionality and is willing to accept the security risks inherent in letting a website run arbitrary code on their machine.
2. Said client runs Internet Explorer, and is willing and able to configure IE to download and run ActiveX controls from your site.
3. You can find or write an ActiveX control which does what you want.

If that's the sort of solution you had in mind all along, I'm sorry for telling you what you already knew. If not, it sounds like you've misunderstood something fundamental.

Anomalous Cowherd
Wednesday, August 18, 2004

Missed something important:

ASP.NET really doesn't have anything to do with your problem, which is how to make the client machine do what you want. Once you solve that, any server-side scripting facility should be able to move the necessary bytes back and forth.

Anomalous Cowherd
Wednesday, August 18, 2004

Sorry, I forgot to mention that this is for an intranet application, not to be accessed over the internet.  I can guarantee IE 6.0 on the clients that would run this.  I specify ASP.NET because I won't be able to use WinForms for this project.

nathan
Wednesday, August 18, 2004

ASP.NET and WinForms are front ends used for GUI creation.  What you do in the behind the scenes is up to you.  Having said that you need to look into the Windows Image Acquisition API.


Wednesday, August 18, 2004

Also check out the Still Image API.

Basically it's vendor specific according to their driver which downloads the images.  (If they even supply a driver most just have a program that does it.)


Wednesday, August 18, 2004

You mention that you can't use WinForms.  Why is that?  I'd suggest that WinForms could be an ideal solution for this problem because:

(a) A WinForms app should be able to use the various APIs already listed in this thread
(b) Deployment is "easy" in an intranet situation with IE 6, as long as you can pre-install the .NET framework on the users' machines.  You may be familiar "easy" deployment already, but if you're  not, see http://homepages.paradise.net.nz/jjrusk/tech/rich_clients.htm , particularly the links at the end re ClickOnce.

John Rusk
Wednesday, August 18, 2004

If you can guarantee IE on the client, your best bet is probably an ActiveX control that handles the camera data.

WinForms would be nice, but to access the hardware will still require an install step even if you use NTD (No Touch Deployment) because you'll need to relax the security sandbox so your app can touch the camera hardware. ActiveX, having no security at all ;-) doesn't have this problem.

Chris Tavares
Thursday, August 19, 2004

May be the OP needs to use the camera on the *server* itself?

For example, the user might want to click a button on the web page and the server asks the camera to snap, gets the picture, and pastes it into the reponse html.

As others have suggested, WIA is the way to go.

Media Man

media_man
Thursday, August 19, 2004

It's not my field, but I seem to recall that there are a few quasi-standard protocols which many digital cameras support if you configure them correctly. That might help with the driver situation.

Anomalous Cowherd
Thursday, August 19, 2004

> but to access the hardware will still require an install step even if you use NTD (No Touch Deployment) because you'll need to relax the security sandbox so your app can touch the camera hardware

I believe Whidbey's ClickOnce bascially takes care of it.  The user is prompted, asking if they want to relax the sanfbox, when the app is used for the first time.  The application author doesn't have to do anything to make that possible.  At least, that's what I recall from what I've read.

John Rusk
Thursday, August 19, 2004

Thanks everyone.  I will definitely check out WIA, and maybe I can convince my boss that a rich client app will be much better suited for this.

Will it be easy to convert an application to ClickOnce when whidbey is released?

nathan
Thursday, August 19, 2004

I'm sure ClickOnce is the bees knees and will clean your floor and cure my acne too. But it doesn't exist right now, not in any way you can ship, and it won't for at least another 6-8 months.

Chris Tavares
Thursday, August 19, 2004

>Will it be easy to convert an application to ClickOnce when whidbey is released?

I presume that it will be, although making assumptions about un-released products is always dangerous.  As another poster mentioned, Whidbey (and therefore ClickOnce) is still quite a few months from release (at least).

I don't know whether ClickOnce is operational in the current Visual Studio 2005 beta.  I presume that it is.  So you could possibly download the beta and have a look.  (I don't know whether the beta is compatible with older versions of the IDE, in a side-by-side installation. You'd have to check the readme).

John Rusk
Thursday, August 19, 2004

*  Recent Topics

*  Fog Creek Home