Bueno muchachos vengo con mi primer post XD estoy estudiando delphi y autoit y pues buscando en Internet encontré este code de multiwedcam en autoit "NO ES MIO" espero que le sea de utilidad y que aprendan con el nombre del archivo MultiWebcam

Código: Seleccionar todo

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\..\..\..\..\tmp\Icones\Webcam_4.ico
#AutoIt3Wrapper_outfile=MultiWebcam.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <AVIConstants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Webcam.au3>
#include <Date.au3>

If Not FileExists("multicam.ini") Then
Iniwrite("multicam.ini","Devices","NumberOfDevice","4")
Iniwrite("multicam.ini","Devices","DeviceName1","")
Iniwrite("multicam.ini","Devices","DeviceName2","")
Iniwrite("multicam.ini","Devices","DeviceName3","")
Iniwrite("multicam.ini","Devices","DeviceName4","")
Iniwrite("multicam.ini","SaveNames","BmpPrefix","")
Iniwrite("multicam.ini","SaveNames","AviPrefix","")
EndIf

#Region ### START Koda GUI section ### Form=c:\program files\ride runner\skins\carwings_dynamic_pm\scripts\multiwebcam\multicam.kxf
$MultiCam = GUICreate("MultiCam", 664, 462, 198, 136)
$wcamid = _WebcamOpen($MultiCam, 12, 15, 257, 201);fenêtre caméra 1
;$wcamid2 = _WebcamOpen($MultiCam, 285, 15, 257, 201);fenêtre caméra 2
;$wcamid3 = _WebcamOpen($MultiCam, 12, 239, 257, 201);fenêtre caméra 3
;$wcamid4 = _WebcamOpen($MultiCam, 285, 239, 257, 201);fenêtre caméra 4
$Cam1 = GUICtrlCreateButton("Cam 1", 552, 78, 44, 46, $BS_FLAT);ON/OFF caméra 1
$Cam2 = GUICtrlCreateButton("Cam 2", 613, 78, 44, 46, $BS_FLAT);ON/OFF caméra 2
$Cam3 = GUICtrlCreateButton("Cam 3", 552, 132, 44, 46, $BS_FLAT);ON/OFF caméra 3
$Cam4 = GUICtrlCreateButton("Cam 4", 613, 132, 44, 46, $BS_FLAT);ON/OFF caméra 4

$Group1 = GUICtrlCreateGroup(" Nbr Of Cam ", 550, 0, 110, 50)
$Group2 = GUICtrlCreateGroup(" Caméra 1 ", 8, 0, 265, 225)
$Group3 = GUICtrlCreateGroup(" Caméra 2 ", 280, 0, 265, 225)
$Group4 = GUICtrlCreateGroup(" Caméra 3 ", 8, 224, 265, 225)
$Group5 = GUICtrlCreateGroup(" Caméra 4 ", 280, 224, 265, 225)
$BTONOFF = GUICtrlCreateGroup(" ON / OFF ", 550, 60, 110, 125)
$Group6 = GUICtrlCreateGroup(" Save Type ", 550, 200, 110, 50)
$BTONOFF = GUICtrlCreateGroup(" Save ", 550, 260, 110, 125)

$SnapShotCam1 = GUICtrlCreateButton("Cam 1", 552, 278, 44, 46, $BS_FLAT);Snap shot caméra 1
$SnapShotCam2 = GUICtrlCreateButton("Cam 2", 611, 278, 44, 46, $BS_FLAT);Snap shot caméra 2
$SnapShotCam3 = GUICtrlCreateButton("Cam 3", 552, 332, 44, 46, $BS_FLAT);Snap shot caméra 3
$SnapShotCam4 = GUICtrlCreateButton("Cam 4", 611, 332, 44, 46, $BS_FLAT);Snap shot caméra 4
$Cancel = GUICtrlCreateButton("Cancel", 595, 402, 60, 00, $BS_FLAT);Sortir du pogramme

;choix du nombre de caméra (1 => 1 seule caméra plein écran , 2,3,4 => écran partagé en quatre)
$NbWebCam = GUICtrlCreateCombo("", 555, 20, 100, 25)
GUICtrlSetData(-1, "1|2|3|4", "4")

$SavePicOrAvi = GUICtrlCreateCombo("", 555, 220, 100, 25)
GUICtrlSetData(-1, "Save Bmp|Save Avi|Save Html>IP", "Save Avi")
$AviSave =  GUICtrlRead($SavePicOrAvi)
;If $AviSave = "Save Avi" Then
;$Group7 = GUICtrlCreateGroup(" Time in s ", 680, 200, 80, 50)
;$AviTime =  GUICtrlCreateCombo("", 685, 220, 50, 25)
;GUICtrlSetData(-1, "5|10", "5")
;EndIf
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE, $Cancel
			Exit

		Case $NbWebCam
			$Nb = GUICtrlRead($NbWebCam)
				Select
                    Case $Nb = "1"
                        _Gui1();GUI une seule caméra prenant toute la fenêtre

                    Case $Nb = "2"
                        _Gui4();GUI quatre caméras sur toute la fenêtre

                    Case $Nb = "3"
                        _Gui4();GUI quatre caméras sur toute la fenêtre

                    Case $Nb = "4"
                        _Gui4();GUI quatre caméras sur toute la fenêtre
                EndSelect

		Case $Cam1;ON/OFF caméra 1

		Case $Cam2;ON/OFF caméra 2

		Case $Cam3;ON/OFF caméra 3

		Case $Cam4;ON/OFF caméra 4

		Case $SnapShotCam1
			;Choix sauvegarde (Bmp ou Avi)
			$SaveCam = GUICtrlRead($SavePicOrAvi)
				Select
                    Case $SaveCam = "Save Bmp"
						_SaveBmp();sauvegarde d'images

                    Case $SaveCam = "Save Avi"
                        _SaveAvi();sauvegarde par vidéo
						Select
							Case $AviTime = "5"

							Case $AviTime = "10"
						EndSelect

					Case $SaveCam = "Save Html>IP"
                        _SaveHtmlIp();sauvegarde Bmp dans page Html
				EndSelect

		Case $SnapShotCam2
			$SaveCam = GUICtrlRead($SavePicOrAvi)
				Select
					Case $SaveCam = "Save Bmp"
;						DateTime()
                        _SaveBmp();sauvegarde d'images

                    Case $SaveCam = "Save Avi"
                        _SaveAvi();sauvegarde par vidéo
                EndSelect

		Case $SnapShotCam3
			$SaveCam = GUICtrlRead($SavePicOrAvi)
				Select
                    Case $SaveCam = "Save Bmp"
                        _SaveBmp();sauvegarde d'images

                    Case $SaveCam = "Save Avi"
                        _SaveAvi();sauvegarde par vidéo
                EndSelect

		Case $SnapShotCam4
			$SaveCam = GUICtrlRead($SavePicOrAvi)
				Select
                    Case $SaveCam = "Save Bmp"
                        _SaveBmp();sauvegarde d'images

                    Case $SaveCam = "Save Avi"
                        _SaveAvi();sauvegarde par vidéo
                EndSelect

	EndSwitch
WEnd

Func _Gui1()
$MultiCam1 = GUICreate("MultiCam", 664, 662, 198, 136)
$wcamid = _WebcamOpen($MultiCam1, 12, 15, 529, 425)
$Cam1 = GUICtrlCreateButton("Cam 1", 552, 78, 44, 46, $BS_FLAT);ON/OFF caméra 1
$Cam2 = GUICtrlCreateButton("Cam 2", 613, 78, 44, 46, $BS_FLAT);ON/OFF caméra 2
$Cam3 = GUICtrlCreateButton("Cam 3", 552, 132, 44, 46, $BS_FLAT);ON/OFF caméra 3
$Cam4 = GUICtrlCreateButton("Cam 4", 613, 132, 44, 46, $BS_FLAT);ON/OFF caméra 4
$Group1 = GUICtrlCreateGroup(" Nbr Of Cam ", 550, 0, 110, 50)
$Group2 = GUICtrlCreateGroup(" Caméra 1 ", 8, 0, 537, 450)
$BTONOFF = GUICtrlCreateGroup(" ON / OFF ", 550, 60, 110, 125)
$Group6 = GUICtrlCreateGroup(" Save Type ", 550, 200, 110, 50)
$BTONOFF = GUICtrlCreateGroup(" Save ", 550, 260, 110, 125)

$SnapShotCam1 = GUICtrlCreateButton("Cam 1", 552, 278, 44, 46, $BS_FLAT);Snap shot caméra 1
$SnapShotCam2 = GUICtrlCreateButton("Cam 2", 611, 278, 44, 46, $BS_FLAT);Snap shot caméra 2
$SnapShotCam3 = GUICtrlCreateButton("Cam 3", 552, 332, 44, 46, $BS_FLAT);Snap shot caméra 3
$SnapShotCam4 = GUICtrlCreateButton("Cam 4", 611, 332, 44, 46, $BS_FLAT);Snap shot caméra 4
$Cancel = GUICtrlCreateButton("Cancel", 595, 402, 60, 00, $BS_FLAT);Sortir du pogramme

;choix du nombre de caméra (1 => 1 seule caméra plein écran , 2,3,4 => écran partagé en quatre)
$NbWebCam = GUICtrlCreateCombo("Nbr of Webcam", 555, 20, 100, 25)
GUICtrlSetData(-1, "1|2|3|4", "1")

$SavePicOrAvi = GUICtrlCreateCombo("Bmp or Avi", 555, 220, 100, 25)
GUICtrlSetData(-1, "Save Bmp|Save Avi|Save Html>IP", "Save Avi")
;If $SavePicOrAvi = "Save Avi" Then
;$AviTime =  GUICtrlCreateCombo("Avi Time", 685, 220, 50, 25)
;GUICtrlSetData(-1, "5|10", "5")
;EndIf
GUISetState(@SW_SHOW)
EndFunc

Func _Gui4()
$MultiCam4 = GUICreate("MultiCam", 664, 462, 198, 136)
$wcamid = _WebcamOpen($MultiCam, 12, 15, 257, 201);fenêtre caméra 1
;$wcamid2 = _WebcamOpen($MultiCam, 285, 15, 257, 201);fenêtre caméra 2
;$wcamid3 = _WebcamOpen($MultiCam, 12, 239, 257, 201);fenêtre caméra 3
;$wcamid4 = _WebcamOpen($MultiCam, 285, 239, 257, 201);fenêtre caméra 4
$Cam1 = GUICtrlCreateButton("Cam 1", 552, 78, 44, 46, $BS_FLAT);ON/OFF caméra 1
$Cam2 = GUICtrlCreateButton("Cam 2", 613, 78, 44, 46, $BS_FLAT);ON/OFF caméra 2
$Cam3 = GUICtrlCreateButton("Cam 3", 552, 132, 44, 46, $BS_FLAT);ON/OFF caméra 3
$Cam4 = GUICtrlCreateButton("Cam 4", 613, 132, 44, 46, $BS_FLAT);ON/OFF caméra 4

$Group1 = GUICtrlCreateGroup(" Nbr Of Cam ", 550, 0, 110, 50)
$Group2 = GUICtrlCreateGroup(" Caméra 1 ", 8, 0, 265, 225)
$Group3 = GUICtrlCreateGroup(" Caméra 2 ", 280, 0, 265, 225)
$Group4 = GUICtrlCreateGroup(" Caméra 3 ", 8, 224, 265, 225)
$Group5 = GUICtrlCreateGroup(" Caméra 4 ", 280, 224, 265, 225)
$BTONOFF = GUICtrlCreateGroup(" ON / OFF ", 550, 60, 110, 125)
$Group6 = GUICtrlCreateGroup(" Save Type ", 550, 200, 110, 50)
$BTONOFF = GUICtrlCreateGroup(" Save ", 550, 260, 110, 125)

$SnapShotCam1 = GUICtrlCreateButton("Cam 1", 552, 278, 44, 46, $BS_FLAT);Snap shot caméra 1
$SnapShotCam2 = GUICtrlCreateButton("Cam 2", 611, 278, 44, 46, $BS_FLAT);Snap shot caméra 2
$SnapShotCam3 = GUICtrlCreateButton("Cam 3", 552, 332, 44, 46, $BS_FLAT);Snap shot caméra 3
$SnapShotCam4 = GUICtrlCreateButton("Cam 4", 611, 332, 44, 46, $BS_FLAT);Snap shot caméra 4
$Cancel = GUICtrlCreateButton("Cancel", 595, 402, 60, 00, $BS_FLAT);Sortir du pogramme

;choix du nombre de caméra (1 => 1 seule caméra plein écran , 2,3,4 => écran partagé en quatre)
$NbWebCam = GUICtrlCreateCombo("Nbr of Webcam", 555, 20, 100, 25)
GUICtrlSetData(-1, "1|2|3|4", "4")

$SavePicOrAvi = GUICtrlCreateCombo("Bmp or Avi", 555, 220, 100, 25)
GUICtrlSetData(-1, "Save Bmp|Save Avi|Save Html>IP", "Save Avi")
;If $SavePicOrAvi = "Save Avi" Then
;$AviTime =  GUICtrlCreateCombo("Avi Time", 685, 220, 50, 25)
;GUICtrlSetData(-1, "5|10", "5")
;EndIf
GUISetState(@SW_SHOW)
EndFunc;Fin Gui à quatre caméras

Func _SaveBmp();sauvegarde de trois images bmp
	;définition du préfix des fichiers sauvegardés
		$DateTime = _Date_Time_GetSystemTime()
		$DateTimeCorrected = StringReplace(StringReplace(StringReplace(_Date_Time_SystemTimeToDateTimeStr($DateTime),"/",""),":","")," ","_")
	If IniRead("multicam.ini","SaveNames","BmpPrefix","") = "" Then
		$PrefixName = $DateTimeCorrected
	Else
		$PrefixName = IniRead("multicam.ini","SaveNames","BmpPrefix","")&$DateTimeCorrected
	EndIf
	    ConsoleWrite("Taking snapshot ..." &$PrefixName& @CRLF)
		_WebcamSnap($wcamid,@ScriptDir & "\"&$PrefixName&".bmp")
EndFunc

Func _SaveAvi();sauvegarde d'une vidéo de N secondes
	;définition du préfix des fichiers sauvegardés
		$DateTime = _Date_Time_GetSystemTime()
		$DateTimeCorrected = StringReplace(StringReplace(StringReplace(_Date_Time_SystemTimeToDateTimeStr($DateTime),"/",""),":","")," ","_")
	If IniRead("multicam.ini","SaveNames","AviPrefix","") = "" Then
		$PrefixName = $DateTimeCorrected
	Else
		$PrefixName = IniRead("multicam.ini","SaveNames","AviPrefix","")&$DateTimeCorrected
	EndIf
		$AviTime = $AviTime
	    ConsoleWrite("Taking snapshot ..." &$PrefixName& " "&$AviTime&@CRLF)
		_WebcamRecordStart(@ScriptDir & "\"&$PrefixName&".avi", $wcamid)

		_WebcamRecordStop($wcamid)
EndFunc

Func _SaveHtmlIp();sauvegarde Bmp dans page Html
EndFunc
Nombre del archivo webcam.au3

Código: Seleccionar todo

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.11.7 (beta)
Author:         Ludocus

Script Function:
       Webcam Udf

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <WindowsConstants.au3>
#include-once
$WM_CAP_START = 0x400
$WM_CAP_UNICODE_START = $WM_CAP_START +100
$WM_CAP_PAL_SAVEA = $WM_CAP_START + 81
$WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81
$WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW
$WM_CAP_ABORT = $WM_CAP_START + 69
$WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46
$WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43
$WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41
$WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42
$WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10
$WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11
$WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14
$WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12
$WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12
$WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13
$WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13
$WM_CAP_EDIT_COPY = $WM_CAP_START + 30
$WM_CAP_END = $WM_CAP_UNICODE_END
$WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22
$WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21
$WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21
$WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23
$WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23
$WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25
$WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25
$WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20
$WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20
$WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24
$WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36
$WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1
$WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67
$WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67
$WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65
$WM_CAP_GET_STATUS = $WM_CAP_START + 54
$WM_CAP_GET_USER_DATA = $WM_CAP_START + 8
$WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44
$WM_CAP_GRAB_FRAME = $WM_CAP_START + 60
$WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61
$WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83
$WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84
$WM_CAP_PAL_OPENA = $WM_CAP_START + 80
$WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80
$WM_CAP_PAL_PASTE = $WM_CAP_START + 82
$WM_CAP_SEQUENCE = $WM_CAP_START + 62
$WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63
$WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35
$WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85
$WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2
$WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2
$WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5
$WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3
$WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3
$WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6
$WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7
$WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4
$WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66
$WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66
$WM_CAP_SET_OVERLAY = $WM_CAP_START + 51
$WM_CAP_SET_PREVIEW = $WM_CAP_START + 50
$WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52
$WM_CAP_SET_SCALE = $WM_CAP_START + 53
$WM_CAP_SET_SCROLL = $WM_CAP_START + 55
$WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64
$WM_CAP_SET_USER_DATA = $WM_CAP_START + 9
$WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45
$WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72
$WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71
$WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70
$WM_CAP_STOP = $WM_CAP_START + 68
#include <GUIConstants.au3>
$avi = DllOpen("avicap32.dll")
$user = DllOpen("user32.dll")

;===============================================================================
;
; Description:      Open's a webcam preview screen in your gui
; Syntax:           _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight)
; Parameter(s):     $sHwnd     - The handle of the gui
;                   $sLeft     - Left coord. of the preview screen
;                   $sTop      - Top coord. of the preview screen
;                   $sWidth    - Width of the preview screen
;                   $sHeight   - Height of the preview screen
; Requirement(s):   A webcam
; Return Value(s):  On Success - Returns id needed for other controls
;                   On Failure - Returns -1
; Author(s):        Ludocus
; Note(s):          None
;
;===============================================================================
func _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight)
$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", $sLeft, "int", $sTop, "int", $sWidth, "int", $sHeight, "hwnd", $sHwnd, "int", 1)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0)
if @error then return -1
return $cap[0]
EndFunc

;===============================================================================
;
; Description:      Creates a Snapshot from a webcam
; Syntax:           _WebcamSnap($sId, $sFile)
; Parameter(s):     $sId       - Id (returned from _WebcamOpen)
;                   $sFile     - File to save the snapshot to (*.bmp)
; Requirement(s):   A webcam
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0
; Author(s):        Ludocus
; Note(s):          None
;
;===============================================================================
Func _WebcamSnap($sId, $sFile)
       DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0)
   DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0)
   DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $sFile)
       if @error Then
               return 0
       Else
               return 1
       EndIf
EndFunc

;===============================================================================
;
; Description:      Closes the preview screen created with _WebcamOpen
; Syntax:           _WebcamClose($sId)
; Parameter(s):     $sId       - Id (returned from _WebcamOpen)
; Requirement(s):   A webcam
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0
; Author(s):        Ludocus
; Note(s):          None
;
;===============================================================================
Func _WebcamClose($sId)
       DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_END, "int", 0, "int", 0)
       DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0)
       DllClose($user)
       if @error Then
               return 0
       Else
               return 1
       EndIf
EndFunc

;===============================================================================
;
; Description:      Starts recording the webcam to a file
; Syntax:           _WebcamRecordStart($sFile, $sId)
; Parameter(s):     $sId       - Id (returned from _WebcamOpen)
;                   $sFile     - File to save the movie to (*.avi)
; Requirement(s):   A webcam
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0
; Author(s):        Ludocus
; Note(s):          Stop recording by: _WebcamRecordStop($Id)
;
;===============================================================================
Func _WebcamRecordStart($sFile, $sId)
   DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $sFile)
   DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0)
       if @error Then
               return 0
       Else
               return 1
       EndIf

EndFunc

;===============================================================================
;
; Description:      Stops recording.
; Syntax:           _WebcamRecordStop($sId)
; Parameter(s):     $sId       - Id (returned from _WebcamOpen)
; Requirement(s):   A webcam
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0
; Author(s):        Ludocus
; Note(s):          None
;
;===============================================================================
Func _WebcamRecordStop($sId)
   DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_STOP, "int", 0, "int", 0)
       if @error Then
               return 0
       Else
               return 1
       EndIf
EndFunc

Explicacion deben estar los dos codes en la misma carpeta y para acerlos funcionar deben ejecuta primero MultiWebcam.au3
suerte y saludos
[code2=masm]"For the honor of a king. And the destiny of a country. All for one."[/code2]
Responder

Volver a “Fuentes”