CCorax Guest
|
Posted: Sat Mar 31, 2007 4:42 am Post subject: Initializing 2 USB camera |
|
|
I have got 2 identical USB camera.When I connect to them the 2nd
allways pops up the videosource window.I have to choose manually the
2nd videosource.How can I eliminate it?
var
F_main: TF_main;
capwnd : array of hwnd;
video: array of TF_child;
procedure TF_main.Prepare1Click(Sender: TObject);
var
Index : integer;
numDrivers : Integer;
begin
numDrivers:=2;
SetLength(capwnd, numDrivers);
SetLength(video, numDrivers);
For Index := 0 To numDrivers-1 do Begin
video[index] := TF_Child.Create(nil); //MDI Child form will show
the video
video[index].ClientWidth:=320;
video[index].ClientHeight:=200;
capwnd[index] := capCreateCaptureWindow('Avicap',ws_Visible or
ws_Child,0,0,video[index].ClientWidth,video[index].ClientHeight,
video[index].Handle ,126);
if SendMessage (CapWnd[index], WM_CAP_DRIVER_CONNECT, 0, 0) <> 0
then video[index].Caption:='OK'
else video[index].Caption:='NOK';
capPreviewRate(CapWnd[index], 66);// '15 FPS 66 default
capPreview(CapWnd[index],true);
SendMessage(CapWnd[index], WM_CAP_SET_Preview, 1, 0);
end;
end; |
|