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

Robert Gustafson 606 Reputation points
2020-12-30T22:44:46.757+00:00

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 Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,892 questions
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,575 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,724 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,159 questions
0 comments No comments
{count} votes

Accepted answer
  1. Robert Gustafson 606 Reputation points
    2020-12-31T06:40:02.997+00:00

    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.)

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,626 Reputation points
    2020-12-31T03:19:38.313+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.