question

RobertGustafson-1682 avatar image
0 Votes"
RobertGustafson-1682 asked RobertGustafson-1682 edited

Why don't my webcam components work in my VB WinForms apps?

WHAT I HAVE:

Visual Basic 2019, .NET 4.6.1, WinForms, Windows 10 Home laptop

MY PROBLEM:

I downloaded WebEye.Controls.WinForms.WebCameraControl from NuGet, and tried to run a VB.NET WinForms program using the control, only to get just a black screen. I then dowloaded OpenCvSharp and tried again with it instead; the same result! What am I doing wrong?! Somehow I get the feeling it's not the choice of control.library. Is there something about webcam settings? I need a WinForms-compatible tool that can reliably work with most users webcams (starting with mine)--preferably free or for less than $250.

PS. I think PVSMediaPlayer will work (I've tried its sample programs)--and it's free. How hard is it to set up a simple webcam photo-capture with it?

PPS. Please respond ASAP, and give any code in VB.NET if possible (although I can convert to that).

windows-10-generaldotnet-visual-basicwindows-formsdotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RobertGustafson-1682 avatar image
1 Vote"
RobertGustafson-1682 answered RobertGustafson-1682 edited

There are multiple webcam device-drivers on a system. One simply needs to try each one until one gets the one that works. (That's why programs supported webcams let you select the driver!)

When I selected the other driver, WebCameraControl and OpenCvSharp both worked like a charm! Persistence and experimentation pays off. (BTW, WebCameraControl is a tad more flexible if you're for a quick-and-dirty solution for image capture.)






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DanielZhang-MSFT avatar image
0 Votes"
DanielZhang-MSFT answered RobertGustafson-1682 commented

Hi RobertGustafson-1682,
In order to find the problem more accurately, could you provide some relevant code to reproduce the problem?
And based on your description, I found some code examples you can refer to.
WebEye
Windows-iotcore-samples
opencvsharp
Hope these are helpful to you.
Best Regards,
Daniel Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I discovered the problem. There are 2 camera drivers on my system and only one works. I selected the wrong one. With both examples, selecting the other one fixes everything. WebCameraControl and OpenCvSharp both work like a charm now! When in doubt, try everything.




0 Votes 0 ·