使用vfw捕获相机 [英] camera capture using vfw

查看:84
本文介绍了使用vfw捕获相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事相机捕获项目.
我必须同时连接两个摄像机.

i am working on camera capturte project.
i have to connect two camera simultaneously.

hMyWindow1 = capCreateCaptureWindow("", WS_CHILD | WS_VISIBLE, rect1.left, rect1.top,rect1.right,rect1.bottom, hw_video1, 0);
  
SendMessage(hMyWindow2,WM_CAP_DRIVER_CONNECT,0,0);

hMyWindow2 = capCreateCaptureWindow("", WS_CHILD | WS_VISIBLE, rect2.left, rect2.top,rect2.right,rect2.bottom, hw_video2, 0);
  
SendMessage(hMyWindow2,WM_CAP_DRIVER_CONNECT,0,0);


现在,第二个窗口也已连接到第一个网络摄像头,以将其更改为第二个网络摄像头,我必须使用


Now second window is also get connected to first web cam for changing it to second webcam i have to use

SendMessage(hMyWindow2,WM_CAP_DLG_VIDEOSOURCE,0,0);


但是我想以编程方式执行此任务,以便使两个网络摄像机在两个不同的窗口上连接n用户无需通过对话框(通过使用


but i want to perform this task programmatic so that two web cams got connected on two different window n user need not to select videosource via dialog (created by using

SendMessage(hMyWindow2,WM_CAP_DLG_VIDEOSOURCE,0,0);

创建)选择视频源.

推荐答案

你好,

在发送WM_CAP_DRIVER_CONNECT消息时,第三个参数指的是DriverIndex,因为您使用的是两个网络摄像头,所以您必须发送两个消息,一个消息的DriverIndex为0,另一个消息的DriverIndex为1.

干杯
Hi,

While Sending the WM_CAP_DRIVER_CONNECT message , the third parameter refers to the DriverIndex, since you are using two webcams, you have to send two messages ,one with DriverIndex as 0, and other with DriverIndex as 1.

Cheers


这篇关于使用vfw捕获相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆