webcam - C# web cam WM_CAP_CONNECT: Want to force a capture source when multiple capture sources present -
I am using the WebCam_Capture code that I got online to access C # through a webcam. It works like magic with a video source on the computer! (The program starts at the beginning, finds the webcam and it works).
However with many video sources on a computer (say a webcam and then many cameras run), the program starts and the user who uses the user asks the question on the restart of a machine To start automatically, I love my program so that the user throws a wrench in waiting for the input, yet I force it to select the source already found Can I go with him?
Then I have some webcam code. I was actually found online here:
And now I did more research in preparing this post and Found that my problem is in this line from the above code:
Send Message (mCapHwnd, WM_CAP_CONNECT, 0, 0);
That connects to the webcam, only one issue is that the above mentioned video source brings the dialog to the front if I have more than one source I want to use the source first So that the dialogue did not come. I tried to pass in different values, where 0 is, sure that the dialog is not enough, but it either does not work. Does anyone know if there is any value that I send to SendMessage Can I pass and still can select the first video source?
I found that the only signal is that the first 0 camera index is:
SendMessage (_windowHandle, WM_CAP_CONNECT, _videoSourceIndex, 0)
Try to give 0,1,2 until the desired camera is connected. Note that it can take up to 5 seconds for the webcam to respond. Some of them are very slow
But the best suggestion library is to try because it is currently more capable than the API you are using.
Comments
Post a Comment