使用双网络摄像头在平板电脑上捕获

时间:2014-08-18 13:44:39

标签: c# webcam

我已经构建了一个应用程序,可以捕获并将从平板电脑摄像头拍摄的图像上传到数据库,该应用程序适用于只有一个网络摄像头的平板电脑,但拒绝从具有双网络摄像头的平板电脑加载驱动程序。我正在使用的代码直接来自另一个代码项目解决方案,我正在使用here

中的代码

有人知道是否有针对运动双网络摄像头的平板电脑的修复程序?

public void Start(ulong FrameNum)
{
    try
    {
        // for safety, call stop, just in case we are already running
        this.Stop();

        // setup a capture window
        mCapHwnd = capCreateCaptureWindowA("WebCap", 0, 0, 0, m_Width, m_Height, this.Handle.ToInt32(), 0);

        // connect to the capture device
        Application.DoEvents();
        SendMessage(mCapHwnd, WM_CAP_CONNECT, 0, 0);
        SendMessage(mCapHwnd, WM_CAP_SET_PREVIEW, 0, 0);

        // set the frame number
        m_FrameNumber = FrameNum;

        // set the timer information
        this.timer1.Interval = m_TimeToCapture_milliseconds;
        bStopped = false;
        this.timer1.Start();
    }

    catch (Exception excep)
    { 
        MessageBox.Show("An error ocurred while starting the video capture. Check that your webcamera is connected properly and turned on.\r\n\n" + excep.Message); 
        this.Stop();
    }
}

0 个答案:

没有答案