English 中文(简体)
Using webcam s button in my own program
原标题:
  • 时间:2009-12-19 19:51:42
  •  标签:
  • c#
  • webcam

My webcam has a button, with which you take a photo of current frame when using it s original software what came with it when I bought it.

Is there any way to use that button to take photos in my program. I would be using C#.

I was thinking of using Windows Image Acquisition (WIA) or avicap32 for using webcam in my software.

Any help would be appreciated. Where do I start?

EDIT:

I see that you didn t understand me. I need to know if my phisycal camera button is pressed. I am using DigiMicro 1.3 camera (Manufacturer is DNT), which isn t really a webcam but a USB microscope, but it behaves like a webcam.

最佳回答

Does the camera actually require that the software be running when you press the button? I know some webcams implement this feature at the driver level. If that s the case, I don t think there s much you can do without interacting directly with the USB port, which would be incredibly difficult and likely not worth the trouble. I can t find any technical documentation on the vendor s website with that kind of information.

The "MicroCapture" software doesn t come with any DLLs that have exported functions, so P/Invoking doesn t appear to be an option. Unfortunately, I can t get the driver installed, so I can t check if it comes with any P/Invoke-able DLLs.

Sorry, but since there s no standard interface for that kind of functionality and the vendor doesn t provide any specific information on it, I don t think this is possible. I would suggest contacting DNT directly about it. They may have some component that will do what you need.

问题回答

This Coding4Fun post guides you through pretty much everything you need to do to get started using WIA, including adding the reference to a project, displaying the select a device dialog, and of course actually taking the picture :P.

Coding4Fun - Look at me! Windows Image Acquisition

I suggest that you take a look at the DirectShow.NET library. It has great functionality for capturing images/videos off connected devices. It also comes with several samples to get you started quickly.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签