BrettF Posted March 20, 2010 Posted March 20, 2010 Hi there,Been trying for a few hours to get the Webcam UDF working with windows 7. I've been trying to run it on my laptop (with the inbuilt) where it works fine, but the minute I try to do it with my external it all goes pear shaped. In the _Webcam() function in the UDF I tried to change the values of:DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0)toDllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 2, "int", 0)But all I end up getting is a blank screen.When set to 0 (only with both plugged in. Still comes up if I disable the inter grated camera). I manage to get this GUI:If I select the intergrated camera, it works fine.I've tried to find drivers for my LifeCam VX-700, but it appears there aren't any. I have however installed the Microsoft LifeCam software and it seemed to indicated it was installing them? Other sources seem to say it doesn't need any.The crappy thing is that I can view the webcam in MSN and use it! It just doesn't seem to want to work for my anywhere else.I would really like to work out the issue before tomorrow as I need the program working for then.Code:expandcollapse popup#include <GUIConstantsEx.au3> #include <Webcam.au3> ;Initiate the webcam _WebcamInit() ;Folder to store images, no trailing slash $image_dir = @ScriptDir & "\" & @YEAR & @MON & @MDAY ;Time between taking images (ms) $timelapse = 2000 ;Size of Webcam Image $width = 320 $height = 240 ;Create $image_dir If Not FileExists ($image_dir) Then DirCreate ($image_dir) ;Create the GUI $gui = GUICreate("Time Lapse", $width, $height) ;Create the webcam on the GUI _Webcam($gui, $width, $height, 0, 0) ToolTip ("Loading") ;Wait for webcam to initate Sleep (5000) ;Show the GUI GUISetState(@SW_SHOW) $timer = TimerInit() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then _WebcamStop() Exit ElseIf $timer >= $timelapse Then _WebcamSnapShot($image_dir & "\" & @MDAY & @MON & @MDAY & @HOUR & @MIN & @SEC & ".jpg") $timer = TimerInit () EndIf WEndCheers,Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BrettF Posted March 21, 2010 Author Posted March 21, 2010 No ideas? I was forced to use a mac to do the time lapse today...! Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
pierrotm777 Posted June 1, 2010 Posted June 1, 2010 Try this webcam udf version. You can init different port (0 to 3)webcam.au3
GEOSoft Posted June 1, 2010 Posted June 1, 2010 Brett, if you have irfanview installed, open it and see if the device is listed in the TWAIN souces. Actually it doesn't have to be irfanview, anything that lists the available TWAIN devices will do it. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now